Error handler in Scheduler uses ID, not UUID

Bug #904971 reported by Sandy Walsh on 2011-12-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Chris Behrens

Bug Description

If the scheduler raises an exception after the Instance db record was added, the instance stays in the BUILD state and cannot be deleted.

Seems that code is still using instance ID vs. UUID.

(PS> don't trust the earlier part of the stack trace, discovered the bug in my dev branch)

2011-12-15 13:16:57,840 ERROR nova.rpc [-] Exception during message handling
(nova.rpc): TRACE: Traceback (most recent call last):
(nova.rpc): TRACE: File "/home/swalsh/github/nova/nova/rpc/", line 620, in _process_data
(nova.rpc): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc): TRACE: File "/home/swalsh/github/nova/nova/scheduler/", line 109, in _schedule
(nova.rpc): TRACE: self._set_instance_error(method, context, ex, *args, **kwargs)
(nova.rpc): TRACE: File "/usr/lib/python2.6/", line 34, in __exit__
(nova.rpc): TRACE: self.gen.throw(type, value, traceback)
(nova.rpc): TRACE: File "/home/swalsh/github/nova/nova/", line 1054, in save_and_reraise_exception
(nova.rpc): TRACE: yield
(nova.rpc): TRACE: File "/home/swalsh/github/nova/nova/scheduler/", line 109, in _schedule
(nova.rpc): TRACE: self._set_instance_error(method, context, ex, *args, **kwargs)
(nova.rpc): TRACE: File "/home/swalsh/github/nova/nova/scheduler/", line 117, in _set_instance_error
(nova.rpc): TRACE: instance_id = kwargs['instance_id']
(nova.rpc): TRACE: KeyError: 'instance_id'
(nova.rpc): TRACE:

Chris Behrens (cbehrens) on 2011-12-15
Changed in nova:
assignee: nobody → Chris Behrens (cbehrens)
importance: Undecided → Medium
status: New → In Progress

Submitter: Jenkins
Branch: master

 status fixcommitted

commit baf7e02f29600e79eacb6c0f747075afeb74fdd5
Author: Chris Behrens <email address hidden>
Date: Thu Dec 15 14:16:42 2011 -0800

    Fix scheduler error handler

    Fixes bug 904971

    Scheduler error handler was looking for instance_id when it may or may
    not exist. Added the proper code for it to determine whether the
    instance was actually created in the DB or not and how to find its ID.

    Note: there's some pretty nasty stuff in here, but unavoidable without
    larger changes. I'd like to hold off on these larger changes, because
    the problem should be solved with some of the scalability work coming.

    Tests included.

    Change-Id: Ief5fde8128437c9dc257af9c4d0c2950d0962ce5

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-01-25
Changed in nova:
milestone: none → essex-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-3 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers