"nova list" fails with exception.ServiceNotFound if service is deleted and has no UUID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
melanie witt | ||
Pike |
In Progress
|
Medium
|
Elod Illes | ||
Queens |
Fix Committed
|
Medium
|
Matt Riedemann | ||
Rocky |
Fix Committed
|
Medium
|
Matt Riedemann | ||
Stein |
Fix Committed
|
Medium
|
Matt Riedemann |
Bug Description
We had a testcase where we booted an instance on Newton, migrated it off the compute node, deleted the compute node (and service), upgraded to Pike, created a new compute node with the same name, and migrated the instance back to the compute node.
At this point the "nova list" command failed with exception.
It appears that since the Service has no UUID the _from_db_object() routine will try to add it, but the service.save() call fails because the service in question has been deleted.
I reproduced the issue with stable/pike devstack. I booted an instance, then created a fake entry in the "services" table without a UUID so the table looked like this:
mysql> select * from services;
+------
| created_at | updated_at | deleted_at | id | host | binary | topic | report_count | disabled | deleted | disabled_reason | last_seen_up | forced_down | version | uuid |
+------
| 2018-02-20 16:10:07 | 2018-04-16 22:10:46 | NULL | 1 | devstack | nova-conductor | conductor | 477364 | 0 | 0 | NULL | 2018-04-16 22:10:46 | 0 | 22 | c041d7cf-
| 2018-02-20 16:10:10 | 2018-04-16 22:10:54 | NULL | 2 | devstack | nova-compute | compute | 477149 | 0 | 0 | NULL | 2018-04-16 22:10:54 | 0 | 22 | d0cfb63c-
| 2018-02-20 16:10:10 | 2018-04-16 20:29:33 | 2018-04-16 20:30:33 | 3 | devstack | nova-compute | compute | 476432 | 0 | 3 | NULL | 2018-04-16 20:30:33 | 0 | 22 | NULL |
+------
At this point, running "nova show <uuid>" worked fine, but running "nova list" failed:
stack@devstack:
ERROR (ClientException): Unexpected API Error. Please report this at http://
<class 'nova.exception
The nova-api log looked like this:
Apr 16 22:11:00 devstack <email address hidden>[4258]: DEBUG nova.compute.api [None req-b7e1b5f9-
Apr 16 22:11:00 devstack <email address hidden>[4258]: DEBUG oslo_concurrenc
Apr 16 22:11:00 devstack <email address hidden>[4258]: DEBUG oslo_concurrenc
Apr 16 22:11:00 devstack <email address hidden>[4258]: DEBUG nova.objects.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: ERROR nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: INFO nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: <class 'nova.exception
Apr 16 22:11:00 devstack <email address hidden>[4258]: DEBUG nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: <class 'nova.exception
Apr 16 22:11:00 devstack <email address hidden>[4258]: INFO nova.api.
Apr 16 22:11:00 devstack <email address hidden>[4258]: [pid: 4261|app: 0|req: 6/12] 128.224.186.226 () {64 vars in 1290 bytes} [Mon Apr 16 22:11:00 2018] GET /compute/
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in nova: | |
assignee: | melanie witt (melwitt) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → melanie witt (melwitt) |
An additional piece of information. ...running "nova show <instance>" as an admin user causes the service to be updated with a valid UUID, but running it as a regular user does not (presumably because it doesn't show the host information).