Public bug reported: If you enable inject metadata plugin or try to use import workflow to create new image along with offering some protection to properties using property protection file then it fails with 500 error in the logs.
How to reproduce: glance-api.conf [Default] property_protection_file=<path-to-property-protection-file> glance-image-import.conf [image_import_opts] image_import_plugins = [inject_image_metadata] [inject_metadata_properties] ignore_user_roles = admin inject = architecture:x86_64,hypervisor_type:qemu cat << EOF > property_protection-roles.conf [hypervisor_type] create = admin,user1 read = admin,user1 update = admin delete = admin EOF Create image using glance image-create-via-import api Expected results: Image should be created successfully Actual result: Failure glance-api logs 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40 e3b86a7ba522243003 - - default default] Failed to stage image data due to internal error: glance.common.exception.ReservedProperty: Attribute 'os_glance _stage_host' is reserved. 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data Traceback (most recent call last): 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 105, in __s etitem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data if self.__getitem__(key) is not None: 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 97, in __ge titem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data raise KeyError 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data KeyError 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data During handling of the above exception, another exception occurred: 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data Traceback (most recent call last): 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 385, in stage 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data image.extra_properties['os_glance_stage_host'] = self_url 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 116, in __s etitem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data raise exception.ReservedProperty(property=key) 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data glance.common.exception.ReservedProperty: Attribute 'os_glance_stage_host' is reserved. 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40e3b86a 7ba522243003 - - default default] Caught error: Attribute 'os_glance_stage_host' is reserved.: glance.common.exception.ReservedProperty: Attribute 'os_g lance_stage_host' is reserved. 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi Traceback (most recent call last): 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 105, in __setitem __ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi if self.__getitem__(key) is not None: 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 97, in __getitem_ _ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise KeyError 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi KeyError 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi During handling of the above exception, another exception occurred: 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi Traceback (most recent call last): 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/wsgi.py", line 1286, in __call__ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi action_result = self.dispatch(self.controller, action, 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/wsgi.py", line 1329, in dispatch 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi return method(*args, **kwargs) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/utils.py", line 414, in wrapped 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi return func(self, req, *args, **kwargs) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 438, in stage 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi self._restore(image_repo, image) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/oslo_utils/excutils.py", line 227, in __exit__ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi self.force_reraise() 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/oslo_utils/excutils.py", line 200, in force_reraise 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise self.value 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 385, in stage 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi image.extra_properties['os_glance_stage_host'] = self_url 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 116, in __setitem __ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise exception.ReservedProperty(property=key) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi glance.common.exception.ReservedProperty: Attribute 'os_glance_stage_host' is reserved. 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.570 18 INFO eventlet.wsgi.server [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40e3b86 a7ba522243003 - - default default] 10.217.1.111,10.217.0.2,::1 - - [19/Sep/2024 07:27:31] "PUT /v2/images/77477613-8b35-49b2-9a69-aab5608bfab6/stage HTT P/1.1" 500 454 0.266991 ** Affects: glance Importance: Undecided Status: Confirmed ** Changed in: glance Status: New => Confirmed -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/2085321 Title: Image import API broken with property protection Status in Glance: Confirmed Bug description: If you enable inject metadata plugin or try to use import workflow to create new image along with offering some protection to properties using property protection file then it fails with 500 error in the logs. How to reproduce: glance-api.conf [Default] property_protection_file=<path-to-property-protection-file> glance-image-import.conf [image_import_opts] image_import_plugins = [inject_image_metadata] [inject_metadata_properties] ignore_user_roles = admin inject = architecture:x86_64,hypervisor_type:qemu cat << EOF > property_protection-roles.conf [hypervisor_type] create = admin,user1 read = admin,user1 update = admin delete = admin EOF Create image using glance image-create-via-import api Expected results: Image should be created successfully Actual result: Failure glance-api logs 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40 e3b86a7ba522243003 - - default default] Failed to stage image data due to internal error: glance.common.exception.ReservedProperty: Attribute 'os_glance _stage_host' is reserved. 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data Traceback (most recent call last): 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 105, in __s etitem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data if self.__getitem__(key) is not None: 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 97, in __ge titem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data raise KeyError 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data KeyError 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data During handling of the above exception, another exception occurred: 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data Traceback (most recent call last): 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 385, in stage 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data image.extra_properties['os_glance_stage_host'] = self_url 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 116, in __s etitem__ 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data raise exception.ReservedProperty(property=key) 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data glance.common.exception.ReservedProperty: Attribute 'os_glance_stage_host' is reserved. 2024-09-19 07:27:31.542 18 ERROR glance.api.v2.image_data 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40e3b86a 7ba522243003 - - default default] Caught error: Attribute 'os_glance_stage_host' is reserved.: glance.common.exception.ReservedProperty: Attribute 'os_g lance_stage_host' is reserved. 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi Traceback (most recent call last): 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 105, in __setitem __ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi if self.__getitem__(key) is not None: 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 97, in __getitem_ _ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise KeyError 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi KeyError 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi During handling of the above exception, another exception occurred: 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi Traceback (most recent call last): 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/wsgi.py", line 1286, in __call__ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi action_result = self.dispatch(self.controller, action, 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/wsgi.py", line 1329, in dispatch 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi return method(*args, **kwargs) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/common/utils.py", line 414, in wrapped 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi return func(self, req, *args, **kwargs) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 438, in stage 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi self._restore(image_repo, image) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/oslo_utils/excutils.py", line 227, in __exit__ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi self.force_reraise() 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/oslo_utils/excutils.py", line 200, in force_reraise 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise self.value 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/v2/image_data.py", line 385, in stage 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi image.extra_properties['os_glance_stage_host'] = self_url 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi File "/usr/lib/python3.9/site-packages/glance/api/property_protections.py", line 116, in __setitem __ 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi raise exception.ReservedProperty(property=key) 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi glance.common.exception.ReservedProperty: Attribute 'os_glance_stage_host' is reserved. 2024-09-19 07:27:31.566 18 ERROR glance.common.wsgi 2024-09-19 07:27:31.570 18 INFO eventlet.wsgi.server [None req-3fc58bbe-dca7-4fdd-b4b4-894400a537dc 5e62dc6d0d3e4c7593cb4621acc5f023 f90b2b308d7e40e3b86 a7ba522243003 - - default default] 10.217.1.111,10.217.0.2,::1 - - [19/Sep/2024 07:27:31] "PUT /v2/images/77477613-8b35-49b2-9a69-aab5608bfab6/stage HTT P/1.1" 500 454 0.266991 To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/2085321/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp