500 response for incorrect node_staging_uri in glance-api.conf
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/
2. Restart glance-api service
3. Import image using below command
$ glance image-create-
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.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi [None req-696e90ed-
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/
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/
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/
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/
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi self._restore(
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi self.force_
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi six.reraise(
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/opt/stack/
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi utils.Cooperati
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi File "/usr/local/
Jun 26 06:28:11 ubuntu-old glance-api[24600]: ERROR glance.common.wsgi raise op_exec_
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.
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.