stores-info --detail command fails if swift store is enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
In Progress
|
High
|
Unassigned |
Bug Description
If you enable swift store in multiple stores setup then glance stores-info --detail or glance stores-info command fails with 500 error "oslo_config.
Note: This error only occurs when you specify "swift_
Sample configuration glance-api.conf:
[DEFAULT]
enabled_backends = dummy:swift
[dummy]
swift_store_
default_
swift_store_
swift_store_
store_description = "This is swift store"
Also in second scenario if you set swift store as below in glance-api.conf then it gives 500 error "Apr 17 04:40:20 akekane-zed-dev glance-
[dummy]
swift_store_
default_
swift_store_
store_description = "This is swift store"
Ideally in scenario 1 glance stores-info --detail command should raise 400 Bad Request and for scenario 2 we need to identify what is ideal configuration for swift multi tenant and return the response accordingly.
Changed in glance: | |
importance: | Undecided → High |
While reproducing this issue, I noticed that image-create also fails with same 500 error if "swift_ store_config_ file = /etc/glance/ glance- swift-store. conf and swift_store_ multi_tenant = True" are specified dor swift store.
$ glance image-create --name testing-swift-1 --container-format bare --disk-format qcow2 --file requirements.txt --store dummy
HTTP 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation.
g-api error: "oslo_config. cfg.NoSuchOptEr ror: no such option store_description in group [dummy]".
The fix would be common for both store-info & image-create since get_stores_detail() internally calls get_stores().
Regarding scenario 2: swift container value can be return as None if it's not set.
In case of swift multitenant enabled, swift recreates the conatiner[1] during image create if it's not set during store configuration. So incase of multitenant enabled, container value could be return None if it's not set while fetching the store details.
[1]: https:/ /github. com/openstack/ glance_ store/blob/ 142593aaee5b341 15f493a9a04aab0 ec4cbf1846/ glance_ store/_ drivers/ swift/store. py#L938