Unexpected API Error is returned, when trying to add fixed IP to an instance in ERROR state

Bug #1533260 reported by Anna Babich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Medium
Unassigned

Bug Description

A negative test case returns an Unexpected API Error, while there is more detailed message in nova-api.log:

2016-01-12 15:12:49.357 22446 ERROR nova.api.openstack.extensions NovaException: Unable to find host for Instance efbbb0cb-fe5f-4047-868e-69305536bcd4
2016-01-12 15:12:49.391 22446 INFO nova.osapi_compute.wsgi.server [req-e22c4d4d-37c8-443d-8038-15ec3f47d01a 7f0fce3a7e3f479b9933eff3df35649d 65d0c9e644ac4c518e76bc9922ef47ee - - -] 192.168.0.2 "POST /v2/65d0c9e644ac4c518e76bc9922ef47ee/servers/efbbb0cb-fe5f-4047-868e-69305536bcd4/action HTTP/1.1" status: 500 len: 428 time: 0.3730938

Steps to reproduce:
1. Create net01: net01__subnet, 192.168.1.0/24:
neutron net-create net01
neutron subnet-create net01 192.168.1.0/24 --enable-dhcp --name net01__subnet
2. Boot an instance vm1 in net01 with incorrect compute node:
NET_ID=$(neutron net-list | grep 'net01' | awk '{print $2}')
nova boot --flavor m1.micro --image TestVM --nic net-id=$NET_ID --security-groups default --availability-zone nova:<some-controller-node.domain.tld> vm1
3. Check that the instance is in ERROR state now and isn’t assigned to any host:
nova show vm1 | grep OS-EXT-SRV-ATTR:host && nova show vm1 | grep status
| OS-EXT-SRV-ATTR:host | - |
| status | ERROR
4. Try to assign fixed IP to the instance vm1 and ensure that it returns an error:
nova add-fixed-ip vm1 $NET_ID

The expected result:
An error message, something like " Returning 409 to user: Cannot 'attach_interface' instance efbbb0cb-fe5f-4047-868e-69305536bcd4 while it is in vm_state error " appears

The actual result:
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'nova.exception.NovaException'> (HTTP 500) (Request-ID: req-e22c4d4d-37c8-443d-8038-15ec3f47d01a)
appears

Nova version - http://paste.openstack.org/show/483603/
nova-api logs for faulty instance - http://paste.openstack.org/show/483611/

Tags: api 500-error
Changed in nova:
assignee: nobody → Anand Shanmugam (anand1712)
tags: added: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/266675

Changed in nova:
status: New → In Progress
Sean Dague (sdague)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Anand Shanmugam (<email address hidden>) on branch: master
Review: https://review.openstack.org/266675

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/285183

Changed in nova:
assignee: Anand Shanmugam (anand1712) → jichenjc (jichenjc)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/285183
Reason: This looks abandoned. If you plan on working on this please restore, rebase and address the comments.

Changed in nova:
assignee: jichenjc (jichenjc) → nobody
status: In Progress → Confirmed
Prateek Arora (parora)
Changed in nova:
assignee: nobody → Prateek Arora (parora)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/356406

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/356406
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in nova:
status: In Progress → Confirmed
assignee: Prateek Arora (parora) → nobody
Sean Dague (sdague)
tags: added: 500-error
ABHAY (ankatare)
Changed in nova:
assignee: nobody → ABHAY (ankatare)
Matt Riedemann (mriedem)
Changed in nova:
assignee: ABHAY (ankatare) → nobody
Revision history for this message
NickKush (nickkush) wrote :

This issue is fixed in current master.

I tried to reproduced it with openstack-cli, and got 409 HTTP response as expected.

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.