500 response for incorrect node_staging_uri in glance-api.conf

Bug #1778645 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned

Bug Description

node_staging_uri configuration option needs a value which always starts with file:///<path>.
If by mistake operator sets value of node_staging_uri without file:/// then import api fails with 500 internal server error.

Steps to reproduce:
1. set below value to node_staging_uri in glance.api.conf
   node_staging_uri = /opt/stack/data/glance/staging
2. Restart glance-api service
3. Import image using below command
   $ glance image-create-via-import --disk-format qcow2 --container-format bare --name test --import-method 'glance-direct' --file <file-path>

Expected output:
Image should be imported successfully and should be in active state.

Actual output:
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)
Image remains in queued state.

glance-api logs:
----------------
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data [None req-696e90ed-1592-4287-a84c-eeaa395852a8 admin admin] Failed to stage image data due to internal error: StoreAddDisabled: Configuration for store failed. Adding images to this store is disabled.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data Traceback (most recent call last):
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data File "/opt/stack/glance/glance/api/v2/image_data.py", line 321, in stage
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data utils.CooperativeReader(data), CONF.image_size_cap), 0)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data File "/usr/local/lib/python2.7/dist-packages/glance_store/capabilities.py", line 223, in op_checker
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data raise op_exec_map[op](**kwargs)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data StoreAddDisabled: Configuration for store failed. Adding images to this store is disabled.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.api.v2.image_data
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi [None req-696e90ed-1592-4287-a84c-eeaa395852a8 admin admin] Caught error: Configuration for store failed. Adding images to this store is disabled.: StoreAddDisabled: Configuration for store failed. Adding images to this store is disabled.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi Traceback (most recent call last):
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 1274, in __call__
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi request, **action_args)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 1317, in dispatch
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi return method(*args, **kwargs)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/glance/glance/common/utils.py", line 417, in wrapped
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi return func(self, req, *args, **kwargs)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/glance/glance/api/v2/image_data.py", line 370, in stage
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi self._restore(image_repo, image)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi self.force_reraise()
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi six.reraise(self.type_, self.value, self.tb)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/glance/glance/api/v2/image_data.py", line 321, in stage
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi utils.CooperativeReader(data), CONF.image_size_cap), 0)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/lib/python2.7/dist-packages/glance_store/capabilities.py", line 223, in op_checker
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi raise op_exec_map[op](**kwargs)
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi StoreAddDisabled: Configuration for store failed. Adding images to this store is disabled.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi
Jun 26 06:28:11 ubuntu-old glance-api[24600]: INFO eventlet.wsgi.server [None req-696e90ed-1592-4287-a84c-eeaa395852a8 admin admin] 192.168.0.9 - - [26/Jun/2018 06:28:11] "PUT /v2/images/1520ef95-ec84-423e-977f-553d091f4ada/stage HTTP/1.1" 500 454 0.352109

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

One of the possible solution is while defining node_staging_uri config option we can use oslo_config.types.URI where we can provide a valid schemes for the same.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.