nova list --deleted as admin fails with 404
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Matt Riedemann |
Bug Description
Mitaka devstack created about a week ago:
stack@neutron:
stack@neutron:
commit 11019fab7a2415c
Author: bhagyashris <email address hidden>
Date: Tue Feb 16 01:13:23 2016 -0800
Remove duplicate key from dictionary
There is a duplicate dictionary key entry in test_vmops.py.
Removed duplicate key 'display_name' from dictionary.
TrivialFix
Change-Id: I4e779bceb26077
stack@neutron:
--
I have a deleted instance:
mysql> select id,uuid,
+----+-
| id | uuid | display_name | deleted |
+----+-
| 1 | 55b9808b-
+----+-
1 row in set (0.00 sec)
I try to list deleted instances using 'nova list --deleted' and it fails with a 404.
Checking the n-api logs there is an InstanceNotFound, it looks like when lazy-loading the instance.services field:
2016-02-23 20:17:25.103 DEBUG nova.objects.
2016-02-23 20:17:25.168 ERROR nova.api.openstack [req-4f701f32-
2016-02-23 20:17:25.168 TRACE nova.api.openstack Traceback (most recent call last):
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return req.get_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack application, catch_exc_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack app_iter = application(
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return resp(environ, start_response)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack response = req.get_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack application, catch_exc_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack app_iter = application(
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return resp(environ, start_response)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return resp(environ, start_response)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack response = self.app(environ, start_response)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return resp(environ, start_response)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack content_type, body, accept)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack request, action_args)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack **action_args)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack instances.values())
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack host_status = self.get_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack service = [service for service in instance.services if
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack self.obj_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack self._load_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack expected_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack result = fn(cls, context, *args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack use_slave=
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return f(*args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack columns_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return IMPL.instance_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return f(*args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/usr/local/
2016-02-23 20:17:25.168 TRACE nova.api.openstack return fn(*args, **kwargs)
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack columns_
2016-02-23 20:17:25.168 TRACE nova.api.openstack File "/opt/stack/
2016-02-23 20:17:25.168 TRACE nova.api.openstack raise exception.
2016-02-23 20:17:25.168 TRACE nova.api.openstack InstanceNotFound: Instance 55b9808b-
2016-02-23 20:17:25.168 TRACE nova.api.openstack
Changed in nova: | |
assignee: | nobody → Matt Riedemann (mriedem) |
tags: | added: mitaka-rc-potential |
tags: | removed: mitaka-rc-potential |
This is the compute API call to get the instance.services:
https:/ /github. com/openstack/ nova/blob/ 11019fab7a2415c bca8b93e9346b21 327e79688d/ nova/compute/ api.py# L3439
Which tries to generically get the updated instance object from the database here:
https:/ /github. com/openstack/ nova/blob/ 11019fab7a2415c bca8b93e9346b21 327e79688d/ nova/objects/ instance. py#L744
But because it's deleted that results in InstanceNotFound.
So we should either update the nova.objects. instance. Instance. obj_load_ attr method to specifically handle the services field, or when we get the instance in the first place we should join on the services table.