terminate_instances raises NoneType not iterable on machine shutdown with Openstack

Bug #862595 reported by Clint Byrum on 2011-09-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pyjuju
Low
Unassigned
txAWS
Undecided
Unassigned
txaws (Ubuntu)
High
Clint Byrum

Bug Description

2011-09-29 10:24:27,572 provision:ec2: juju.agents.provision DEBUG: Machines changed old:set([0, 1, 2, 3, 4]) new:set([0, 1, 2, 3])
2011-09-29 10:24:27,708 provision:ec2: juju.agents.provision INFO: Shutting down machine id:i-000005fa ...
2011-09-29 10:24:27,892 provision:ec2: twisted ERROR: Unhandled error in Deferred:
2011-09-29 10:24:27,895 provision:ec2: twisted ERROR: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 388, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 455, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 542, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1076, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1018, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 350, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "juju/state/base.py", line 138, in __topology_changed
    yield watch_topology_function(self._old_topology, new_topology)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1018, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 350, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/juju/juju/juju/agents/provision.py", line 206, in process_machines
    yield self.provider.shutdown_machine(machine)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1018, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 350, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "juju/providers/ec2/__init__.py", line 168, in shutdown_machines
    terminated = yield self.ec2.terminate_instances(*killable_ids)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 542, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/txaws/ec2/client.py", line 633, in terminate_instances
    for instance in root.find("instancesSet"):
exceptions.TypeError: 'NoneType' object is not iterable

This only happens when talking to openstack, not EC2. It does not cause any failures, just an unexpected error message.

Related branches

Changed in juju:
importance: Undecided → Low
Clint Byrum (clint-fewbar) wrote :

This is due to bug #862680 in nova-api, which has it returning the wrong thing for TerminateInstances.

summary: - Provisioning agent and destroy-environment show NoneType not iterable on
- machine shutdown with Openstack
+ terminate_instances raises NoneType not iterable on machine shutdown
+ with Openstack
Changed in juju:
status: New → Invalid
Clint Byrum (clint-fewbar) wrote :

The code does assume there will always be at least an empty instancesSet, which I think is fair to do. However, a simple check to make sure that it is there before trying to iterate over it would be more defensive given the difference in nova's response.

Changed in txaws (Ubuntu):
status: New → Triaged
importance: Undecided → High
milestone: none → ubuntu-11.10
assignee: nobody → Clint Byrum (clint-fewbar)
Changed in txaws (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package txaws - 0.2-0ubuntu5

---------------
txaws (0.2-0ubuntu5) oneiric; urgency=low

  * debian/patches/fix-openstack-terminate-instances: Make sure txaws
    reliably returns from terminate_instances when talking to Nova.
    (LP: #862595)
 -- Clint Byrum <email address hidden> Thu, 29 Sep 2011 18:26:35 -0700

Changed in txaws (Ubuntu):
status: Fix Committed → Fix Released
Changed in txaws:
status: New → Fix Committed
Changed in txaws:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers