yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #95646
[Bug 2106085] [NEW] Lock action API return 500 error if no instance information
Public bug reported:
The Lock Server API raises 500 InternalServer error with
oslo_db.exception.DBReferenceError if the lock API is called just after
create server API returns its response.
ERROR response:
{"computeFault": {"code": 500, "message": "Unexpected API Error. Please
report this at http://bugs.launchpad.net/nova/ and attach the Nova API
log if possible.\n<class 'oslo_db.exception.DBReferenceError'>"}}
ERROR reason:
The server lock API makes instance action record in the beginning of its
operation. The instance action record has foreign key to cell's instance
id column, so if the lock API is called before instance information is
not created in the cell db, the lock API returns 500 internal error.
How to reproduce:
Run the following 2 line script.
instance_id=$(curl -X POST https://nova-
endpoint.example.com/v2.1/servers -H "Accept: application/json" -H
"Content-Type: application/json" -H "OpenStack-API-Version: compute
2.96" -H "User-Agent: python-novaclient" -H "X-Auth-Token: ${OS_TOKEN}"
-H "X-OpenStack-Nova-API-Version: 2.96" -d '{"server": {"name": "lock-
api-failure", "imageRef": "bc638e70-fcc2-416a-84e4-9acd18cc07e6",
"flavorRef": "1", "min_count": 1, "max_count": 1, "networks": [{"uuid":
"d45b8c45-8977-4820-9df0-e09134197be6"}]}}' | jq '.server.id' -r)
curl -X POST https://nova-
endpoint.example.com/v2.1/servers/${instance_id}/action -H "Accept:
application/json" -H "Content-Type: application/json" -H "OpenStack-API-
Version: compute 2.96" -H "User-Agent: python-novaclient" -H "X-Auth-
Token: ${OS_TOKEN}" -H "X-OpenStack-Nova-API-Version: 2.96" -d '{"lock":
null}'
** Affects: nova
Importance: Undecided
Assignee: Masahito Muroi (muroi-masahito)
Status: New
** Changed in: nova
Assignee: (unassigned) => Masahito Muroi (muroi-masahito)
--
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/2106085
Title:
Lock action API return 500 error if no instance information
Status in OpenStack Compute (nova):
New
Bug description:
The Lock Server API raises 500 InternalServer error with
oslo_db.exception.DBReferenceError if the lock API is called just
after create server API returns its response.
ERROR response:
{"computeFault": {"code": 500, "message": "Unexpected API Error.
Please report this at http://bugs.launchpad.net/nova/ and attach the
Nova API log if possible.\n<class
'oslo_db.exception.DBReferenceError'>"}}
ERROR reason:
The server lock API makes instance action record in the beginning of
its operation. The instance action record has foreign key to cell's
instance id column, so if the lock API is called before instance
information is not created in the cell db, the lock API returns 500
internal error.
How to reproduce:
Run the following 2 line script.
instance_id=$(curl -X POST https://nova-
endpoint.example.com/v2.1/servers -H "Accept: application/json" -H
"Content-Type: application/json" -H "OpenStack-API-Version: compute
2.96" -H "User-Agent: python-novaclient" -H "X-Auth-Token:
${OS_TOKEN}" -H "X-OpenStack-Nova-API-Version: 2.96" -d '{"server":
{"name": "lock-api-failure", "imageRef":
"bc638e70-fcc2-416a-84e4-9acd18cc07e6", "flavorRef": "1", "min_count":
1, "max_count": 1, "networks": [{"uuid":
"d45b8c45-8977-4820-9df0-e09134197be6"}]}}' | jq '.server.id' -r)
curl -X POST https://nova-
endpoint.example.com/v2.1/servers/${instance_id}/action -H "Accept:
application/json" -H "Content-Type: application/json" -H "OpenStack-
API-Version: compute 2.96" -H "User-Agent: python-novaclient" -H
"X-Auth-Token: ${OS_TOKEN}" -H "X-OpenStack-Nova-API-Version: 2.96" -d
'{"lock": null}'
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2106085/+subscriptions