Reviewed: https://review.opendev.org/752211 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=32c43fc8017ee89d4e6cdf79086d87735a00f0c0 Submitter: Zuul Branch: master
commit 32c43fc8017ee89d4e6cdf79086d87735a00f0c0 Author: Stephen Finucane <[email protected]> Date: Wed Sep 16 10:59:49 2020 +0100 api: Set min, maxItems for server_group.policies field As noted inline, the 'policies' field may be a list but it expects one of two items. Change-Id: I34c68df1e6330dab1524aa0abec733610211a407 Signed-off-by: Stephen Finucane <[email protected]> Closes-Bug: #1894966 ** Changed in: nova Status: In Progress => Fix Released -- 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/1894966 Title: Create servergroup failed with unexpected error Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) ocata series: Confirmed Status in OpenStack Compute (nova) pike series: Confirmed Status in OpenStack Compute (nova) queens series: Confirmed Status in OpenStack Compute (nova) rocky series: Confirmed Status in OpenStack Compute (nova) stein series: Confirmed Status in OpenStack Compute (nova) train series: Confirmed Status in OpenStack Compute (nova) ussuri series: Confirmed Bug description: Create a serverGroup with policies set to [] will cause nova api return unexpected error. Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.307 9 DEBUG nova.api.openstack.wsgi [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] Action: 'create', calling method: <function Controller.__getattribute__.<locals>.version_select at 0x7f0600e5d680>, body: {"server_group": {"name": "tpp-test-archetype-app-sandbox-vlyo", "policies": []}} _process_stack /usr/lib/python3.7/site-packages/nova/api/openstack/wsgi.py:520 Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.336 9 DEBUG nova.quota [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] Getting quotas for project 9425beb60c8746518fd77513191623ea. Resources: {'server_groups'} _get_quotas /usr/lib/python3.7/site-packages/nova/quota.py:390 Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.340 9 DEBUG nova.quota [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] Getting quotas for user 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 and project 9425beb60c8746518fd77513191623ea. Resources: {'server_groups'} _get_quotas /usr/lib/python3.7/site-packages/nova/quota.py:382 Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] Unexpected exception in API method: IndexError: list index out of range Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi Traceback (most recent call last): Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.7/site-packages/nova/api/openstack/wsgi.py", line 671, in wrapped Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi return f(*args, **kwargs) Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi return func(*args, **kwargs) Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.7/site-packages/nova/api/openstack/compute/server_groups.py", line 201, in create Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi sg = objects.InstanceGroup(context, policy=policies[0]) Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi IndexError: list index out of range Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.351 9 ERROR nova.api.openstack.wsgi Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.354 9 INFO nova.api.openstack.wsgi [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: <class 'IndexError'> Aug 25 15:16:16 controller-qf47h5jn62 nova-osapi[752]: 2020-08-25 15:16:16.355 9 DEBUG nova.api.openstack.wsgi [req-d2edaa0f-bc9f-42ac-ba85-1273d25f3799 451d8d24f6428a3cef7409695abb6cbd3a1c4d2ef2b459e1fcdf75a848be8294 9425beb60c8746518fd77513191623ea - default default] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1894966/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

