Error 500 occurs when requesting API simultaneously

Bug #2037241 reported by Yonghyun Kim
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Yonghyun Kim

Bug Description

Description
===========

If you make multiple reboot API requests simultaneously, a 500 error response will occur.

Steps to reproduce
==================

test_reboot.sh
-------------------------------------------
#!/bin/bash

INSTANCE=$1

for i in $(seq 1 2)
do
    echo "reboot instance: $INSTANCE"
    openstack server reboot $INSTANCE &
done
-------------------------------------------

run script
-------------------------------------------
$ bash test_reboot.sh
-------------------------------------------

Expected result
===============

I expect a 202 or 409 response to be output.

Actual result
=============

Of the two requests, one was performed normally with a 202 response, and the other responded with a 500 error.

-------------------------------------------
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'nova.exception.UnexpectedTaskStateError'> (HTTP 500) (Request-ID: req-062f90da-d980-4d23-9624-2c37874fc9ef)
-------------------------------------------

nova-api log
-------------------------------------------
2023-09-25 10:38:05.028 9285 ERROR nova.api.openstack.wsgi [req-062f90da-d980-4d23-9624-2c37874fc9ef e306fe82332941d8a5317738a21cf82c 0f6727c6cc434a219ed84d076d4b0e05 - default default] Unexpected exception in API method: UnexpectedTaskStateError: Conflict updating instance 88ca51ce-f75e-4782-b6cd-85cdc4eb461b. Expected: {'task_state': [None]}. Actual: {'task_state': u'rebooting'}
2023-09-25 10:38:05.038 9285 INFO nova.api.openstack.wsgi [req-062f90da-d980-4d23-9624-2c37874fc9ef e306fe82332941d8a5317738a21cf82c 0f6727c6cc434a219ed84d076d4b0e05 - 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.
2023-09-25 10:38:05.039 9285 DEBUG nova.api.openstack.wsgi [req-062f90da-d980-4d23-9624-2c37874fc9ef e306fe82332941d8a5317738a21cf82c 0f6727c6cc434a219ed84d076d4b0e05 - 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.
2023-09-25 10:38:05.043 9285 INFO nova.osapi_compute.wsgi.server [req-062f90da-d980-4d23-9624-2c37874fc9ef e306fe82332941d8a5317738a21cf82c 0f6727c6cc434a219ed84d076d4b0e05 - default default] 192.168.0.1 "POST /v2.1/servers/88ca51ce-f75e-4782-b6cd-85cdc4eb461b/action HTTP/1.1" status: 500 len: 646 time: 1.3927691
-------------------------------------------

Environment
===========

* openstack version: queens
* libvirt + kvm

Yonghyun Kim (kshusil82)
Changed in nova:
assignee: nobody → Yonghyun Kim (kshusil82)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/896320

Changed in nova:
status: New → In Progress
Yonghyun Kim (kshusil82)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.