New image import api with glance-direct or web-download fails to import image if cloud is using python3.5. Image stuck in uploading state forever.
Steps:
1. Ensure you are running glance on python 3.5
Add below lines in your devstack/local.conf
WSGI_MODE=mod_wsgi
USE_PYTHON3=True
PYTHON3_VERSION=3.5
2. Source devstack/openrc using "$ source devstack/openrc admin admin"
3. Create image using new import api
$ glance image-create-via-import --container-format ami --disk-format ami --name cirros_image --file <file_path>
g-api logs:
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: |__Flow 'api_image_import': TypeError: Unicode-objects must be encoded before hashing
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor Traceback (most recent call last):
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor result = task.execute(**arguments)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/async/flows/api_image_import.py", line 218, in execute
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor image_import.set_image_data(image, file_path or self.uri, self.task_id)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/common/scripts/image_import/main.py", line 154, in set_image_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor "task_id": task_id})
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.force_reraise()
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor six.reraise(self.type_, self.value, self.tb)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/six.py", line 693, in reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor raise value
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/common/scripts/image_import/main.py", line 146, in set_image_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor image.set_data(data_iter)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/domain/proxy.py", line 195, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.base.set_data(data, size)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/notifier.py", line 480, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor _send_notification(notify_error, 'image.upload', msg)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.force_reraise()
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor six.reraise(self.type_, self.value, self.tb)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/six.py", line 693, in reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor raise value
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/notifier.py", line 427, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.repo.set_data(data, size)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/api/policy.py", line 193, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor return self.image.set_data(*args, **kwargs)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/quota/__init__.py", line 304, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.image.set_data(data, size=size)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/opt/stack/glance/glance/location.py", line 439, in set_data
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor verifier=verifier)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/glance_store/backend.py", line 453, in add_to_backend
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor verifier)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/glance_store/backend.py", line 426, in store_add_to_backend
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor verifier=verifier)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/glance_store/capabilities.py", line 225, in op_checker
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor return store_op_fun(store, *args, **kwargs)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/glance_store/_drivers/filesystem.py", line 697, in add
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self._delete_partial(filepath, image_id)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor self.force_reraise()
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor six.reraise(self.type_, self.value, self.tb)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/six.py", line 693, in reraise
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor raise value
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor File "/usr/local/lib/python3.5/dist-packages/glance_store/_drivers/filesystem.py", line 684, in add
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor checksum.update(buf)
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor TypeError: Unicode-objects must be encoded before hashing
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.async.taskflow_executor
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: DEBUG glance.async.taskflow_executor [-] Task 'api_image_import-ImportToStore-a4ef0f11-2e4f-4ed8-ac4a-cbb28293a513' (74506991-d9ed-4fdf-819a-21dcadca3c04) transitioned into state 'REVERTING' from state 'FAILURE' {{(pid=23619) _task_receiver /usr/local/lib/python3.5/dist-packages/taskflow/listeners/logging.py:194}}
New image import api with glance-direct or web-download fails to import image if cloud is using python3.5. Image stuck in uploading state forever.
Steps: MODE=mod_ wsgi VERSION= 3.5
1. Ensure you are running glance on python 3.5
Add below lines in your devstack/local.conf
WSGI_
USE_PYTHON3=True
PYTHON3_
2. Source devstack/openrc using "$ source devstack/openrc admin admin"
3. Create image using new import api via-import --container-format ami --disk-format ami --name cirros_image --file <file_path>
$ glance image-create-
g-api logs:
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: |__Flow 'api_image_import': TypeError: Unicode-objects must be encoded before hashing async.taskflow_ executor Traceback (most recent call last): async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ taskflow/ engines/ action_ engine/ executor. py", line 53, in _execute_task async.taskflow_ executor result = task.execute( **arguments) async.taskflow_ executor File "/opt/stack/ glance/ glance/ async/flows/ api_image_ import. py", line 218, in execute async.taskflow_ executor image_import. set_image_ data(image, file_path or self.uri, self.task_id) async.taskflow_ executor File "/opt/stack/ glance/ glance/ common/ scripts/ image_import/ main.py" , line 154, in set_image_data async.taskflow_ executor "task_id": task_id}) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 220, in __exit__ async.taskflow_ executor self.force_ reraise( ) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 196, in force_reraise async.taskflow_ executor six.reraise( self.type_ , self.value, self.tb) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ six.py" , line 693, in reraise async.taskflow_ executor raise value async.taskflow_ executor File "/opt/stack/ glance/ glance/ common/ scripts/ image_import/ main.py" , line 146, in set_image_data async.taskflow_ executor image.set_ data(data_ iter) async.taskflow_ executor File "/opt/stack/ glance/ glance/ domain/ proxy.py" , line 195, in set_data async.taskflow_ executor self.base. set_data( data, size) async.taskflow_ executor File "/opt/stack/ glance/ glance/ notifier. py", line 480, in set_data async.taskflow_ executor _send_notificat ion(notify_ error, 'image.upload', msg) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 220, in __exit__ async.taskflow_ executor self.force_ reraise( ) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 196, in force_reraise async.taskflow_ executor six.reraise( self.type_ , self.value, self.tb) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ six.py" , line 693, in reraise async.taskflow_ executor raise value async.taskflow_ executor File "/opt/stack/ glance/ glance/ notifier. py", line 427, in set_data async.taskflow_ executor self.repo. set_data( data, size) async.taskflow_ executor File "/opt/stack/ glance/ glance/ api/policy. py", line 193, in set_data async.taskflow_ executor return self.image. set_data( *args, **kwargs) async.taskflow_ executor File "/opt/stack/ glance/ glance/ quota/_ _init__ .py", line 304, in set_data async.taskflow_ executor self.image. set_data( data, size=size) async.taskflow_ executor File "/opt/stack/ glance/ glance/ location. py", line 439, in set_data async.taskflow_ executor verifier=verifier) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ glance_ store/backend. py", line 453, in add_to_backend async.taskflow_ executor verifier) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ glance_ store/backend. py", line 426, in store_add_ to_backend async.taskflow_ executor verifier=verifier) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ glance_ store/capabilit ies.py" , line 225, in op_checker async.taskflow_ executor return store_op_fun(store, *args, **kwargs) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ glance_ store/_ drivers/ filesystem. py", line 697, in add async.taskflow_ executor self._delete_ partial( filepath, image_id) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 220, in __exit__ async.taskflow_ executor self.force_ reraise( ) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ oslo_utils/ excutils. py", line 196, in force_reraise async.taskflow_ executor six.reraise( self.type_ , self.value, self.tb) async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ six.py" , line 693, in reraise async.taskflow_ executor raise value async.taskflow_ executor File "/usr/local/ lib/python3. 5/dist- packages/ glance_ store/_ drivers/ filesystem. py", line 684, in add async.taskflow_ executor checksum. update( buf) async.taskflow_ executor TypeError: Unicode-objects must be encoded before hashing async.taskflow_ executor async.taskflow_ executor [-] Task 'api_image_ import- ImportToStore- a4ef0f11- 2e4f-4ed8- ac4a-cbb28293a5 13' (74506991- d9ed-4fdf- 819a-21dcadca3c 04) transitioned into state 'REVERTING' from state 'FAILURE' {{(pid=23619) _task_receiver /usr/local/ lib/python3. 5/dist- packages/ taskflow/ listeners/ logging. py:194} }
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: ERROR glance.
Mar 28 08:36:01 ubuntu-3 glance-api[23449]: DEBUG glance.