yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #93993
[Bug 2065916] [NEW] OpenStack's Nova API encounters a UnicodeDecodeError when attempting to handle project names containing special characters, leading to a failure in executing operations like terraform destroy
Public bug reported:
When attempting to execute terraform destroy in the "TADventure
Tantésys" project within OpenStack, an error occurs due to special
characters in the project name. Specifically, the presence of the
accented character "é" in the project name leads to a UnicodeDecodeError
during the deletion process, resulting in a 500 error response instead
of the expected 404 response. This issue prevents Terraform from
successfully destroying resources that have already been manually
deleted from the OpenStack dashboard.
The specific error returned by OpenStack is:
{"computeFault": {"code": 500, "message": "The server has either erred or is incapable of performing the requested operation."}}
Upon investigating the Nova API logs, we observed the following traceback:
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._app)
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 826: invalid continuation byte
The error logs:
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._app)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1313, in send
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack status, headers, app_iter = self.call_application(
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1278, in call_application
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 129, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/keystonemiddleware/audit/__init__.py", line 159, in _
_call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._application)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1313, in send
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack status, headers, app_iter = self.call_application(
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1278, in call_application
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/routes/middleware.py", line 153, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = self.app(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 129, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/nova/api/openstack/wsgi.py", line 486, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self._process_stack(request, action, action_args,
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/nova/api/openstack/wsgi.py", line 541, in _process_st
ack
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack LOG.debug(f'Request method failure captured:\n'
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1179, in as_text
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return bytes.decode(self.charset)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 826: invalid continuation byte
This error occurs because the project name contains a special character
(é), causing the UTF-8 decoding process to fail. However, the root issue
is that Terraform attempts to delete a VM that no longer exists, and the
API does not handle this scenario gracefully.
Steps to Reproduce:
source keystonerc
export OS_PROJECT_NAME="TADventure Tantésys"
openstack token issue
# replace with your token
export OS_TOKEN=""
curl -X DELETE https://nova.tytesnet.net/v2.1/6bbe727a7d524579a367d46af74087/servers/3842729c-ef45-49c9-ad81-88e8a91065989 -H "X-Auth-Token: $OS_TOKEN"
Expected Behavior:
Executing terraform destroy should return a 404 error when attempting to delete a resource that has already been manually deleted from the OpenStack dashboard, regardless of any special characters in the project name.
Actual Behavior:
The presence of special characters in the project name, such as "é" in "TADventure Tantésys" leads to a UnicodeDecodeError during the deletion process, resulting in a 500 error response instead of the expected 404 response.
** Affects: nova
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2065916
Title:
OpenStack's Nova API encounters a UnicodeDecodeError when attempting
to handle project names containing special characters, leading to a
failure in executing operations like terraform destroy
Status in OpenStack Compute (nova):
New
Bug description:
When attempting to execute terraform destroy in the "TADventure
Tantésys" project within OpenStack, an error occurs due to special
characters in the project name. Specifically, the presence of the
accented character "é" in the project name leads to a
UnicodeDecodeError during the deletion process, resulting in a 500
error response instead of the expected 404 response. This issue
prevents Terraform from successfully destroying resources that have
already been manually deleted from the OpenStack dashboard.
The specific error returned by OpenStack is:
{"computeFault": {"code": 500, "message": "The server has either erred or is incapable of performing the requested operation."}}
Upon investigating the Nova API logs, we observed the following traceback:
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._app)
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 826: invalid continuation byte
The error logs:
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._app)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1313, in send
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack status, headers, app_iter = self.call_application(
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1278, in call_application
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 129, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/keystonemiddleware/audit/__init__.py", line 159, in _
_call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = req.get_response(self._application)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1313, in send
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack status, headers, app_iter = self.call_application(
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1278, in call_application
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/routes/middleware.py", line 153, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack response = self.app(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 143, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return resp(environ, start_response)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 129, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/nova/api/openstack/wsgi.py", line 486, in __call__
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return self._process_stack(request, action, action_args,
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/nova/api/openstack/wsgi.py", line 541, in _process_st
ack
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack LOG.debug(f'Request method failure captured:\n'
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack File "/var/lib/openstack/lib/python3.8/site-packages/webob/request.py", line 1179, in as_text
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack return bytes.decode(self.charset)
nova-api-osapi-76d4466df7-cqqc2 nova-osapi 2024-05-16 13:46:58.408 1 ERROR nova.api.openstack UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 826: invalid continuation byte
This error occurs because the project name contains a special
character (é), causing the UTF-8 decoding process to fail. However,
the root issue is that Terraform attempts to delete a VM that no
longer exists, and the API does not handle this scenario gracefully.
Steps to Reproduce:
source keystonerc
export OS_PROJECT_NAME="TADventure Tantésys"
openstack token issue
# replace with your token
export OS_TOKEN=""
curl -X DELETE https://nova.tytesnet.net/v2.1/6bbe727a7d524579a367d46af74087/servers/3842729c-ef45-49c9-ad81-88e8a91065989 -H "X-Auth-Token: $OS_TOKEN"
Expected Behavior:
Executing terraform destroy should return a 404 error when attempting to delete a resource that has already been manually deleted from the OpenStack dashboard, regardless of any special characters in the project name.
Actual Behavior:
The presence of special characters in the project name, such as "é" in "TADventure Tantésys" leads to a UnicodeDecodeError during the deletion process, resulting in a 500 error response instead of the expected 404 response.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2065916/+subscriptions