yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #88652
[Bug 1968618] [NEW] get-vnc-console returns 500 if instance in invalid task_state
Public bug reported:
Description
===========
Nova returns 500 when you create console for instance which is in transition state like deleting or migrating.
Steps to reproduce
==================
1. Instance in task_state deleting or migrating
mysql> select task_state from instances where uuid='35a5c36e-5464-4747-97a8-c160da093101';
+------------+
| task_state |
+------------+
| migrating |
+------------+
2. Try to get console
# openstack console url show --novnc 35a5c36e-5464-4747-97a8-c160da093101
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'nova.exception.InstanceInvalidState'> (HTTP 500) (Request-ID: req-8dd68e78-1956-4e0c-90ee-d2a5e1be54bf)
Same error with "nova get-vnc-console"
Expected result
===============
Nova usually returns HTTP 409 when catches InstanceInvalidState.
Environment
===========
Currently seeing in Stein. But it seems nova doesn't catch this exception in other versions.
Logs & Configs
==============
2022-04-11 18:59:24,404.404 11 ERROR nova.api.openstack.wsgi [req-f057dae1-9a9a-4db5-8faf-db655b904a0e b6ba9c75146a49829a7427a3e8cc3c10 192796e61c174f718d6147b129f3f2ff] Unexpected exception in API method: nova.exception.InstanceInvalidState: Instance 35a5c36e-5464-4747-97a8-c160da093101 in task_state migrating. Cannot get_vnc_console while the instance is in this state.
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/openstack/wsgi.py", line 671, in wrapped
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return f(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return func(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return func(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/openstack/compute/remote_consoles.py", line 168, in create
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi output = handler(context, instance, console_type)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/compute/api.py", line 199, in wrapped
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return function(self, context, instance, *args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/compute/api.py", line 187, in inner
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi attr='task_state', state=instance.task_state)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi nova.exception.InstanceInvalidState: Instance 35a5c36e-5464-4747-97a8-c160da093101 in task_state migrating. Cannot get_vnc_console while the instance is in this state.
** 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/1968618
Title:
get-vnc-console returns 500 if instance in invalid task_state
Status in OpenStack Compute (nova):
New
Bug description:
Description
===========
Nova returns 500 when you create console for instance which is in transition state like deleting or migrating.
Steps to reproduce
==================
1. Instance in task_state deleting or migrating
mysql> select task_state from instances where uuid='35a5c36e-5464-4747-97a8-c160da093101';
+------------+
| task_state |
+------------+
| migrating |
+------------+
2. Try to get console
# openstack console url show --novnc 35a5c36e-5464-4747-97a8-c160da093101
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'nova.exception.InstanceInvalidState'> (HTTP 500) (Request-ID: req-8dd68e78-1956-4e0c-90ee-d2a5e1be54bf)
Same error with "nova get-vnc-console"
Expected result
===============
Nova usually returns HTTP 409 when catches InstanceInvalidState.
Environment
===========
Currently seeing in Stein. But it seems nova doesn't catch this exception in other versions.
Logs & Configs
==============
2022-04-11 18:59:24,404.404 11 ERROR nova.api.openstack.wsgi [req-f057dae1-9a9a-4db5-8faf-db655b904a0e b6ba9c75146a49829a7427a3e8cc3c10 192796e61c174f718d6147b129f3f2ff] Unexpected exception in API method: nova.exception.InstanceInvalidState: Instance 35a5c36e-5464-4747-97a8-c160da093101 in task_state migrating. Cannot get_vnc_console while the instance is in this state.
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/openstack/wsgi.py", line 671, in wrapped
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return f(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return func(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return func(*args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/api/openstack/compute/remote_consoles.py", line 168, in create
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi output = handler(context, instance, console_type)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/compute/api.py", line 199, in wrapped
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi return function(self, context, instance, *args, **kwargs)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi File "/var/lib/openstack/lib/python3.6/site-packages/nova/compute/api.py", line 187, in inner
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi attr='task_state', state=instance.task_state)
2022-04-11 18:59:24,404.404 11 TRACE nova.api.openstack.wsgi nova.exception.InstanceInvalidState: Instance 35a5c36e-5464-4747-97a8-c160da093101 in task_state migrating. Cannot get_vnc_console while the instance is in this state.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1968618/+subscriptions
Follow ups