Failed to spawn an instance : AttributeError: 'str' object has no attribute 'fileno'

Bug #733609 reported by Tushar Patil
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Soren Hansen

Bug Description

Tested trunk on Revision no 790.

If I start a new instance, it fails to spawn.
DescribeInstance status - Failed to spawn

nova-compute.log
-------------------------
2011-03-11 15:56:56,283 AUDIT nova.compute.manager [UEGXDCVTAY-IA6K1ILRO admin admin] instance 1: starting...
2011-03-11 15:56:56,399 DEBUG nova.rpc [-] Making asynchronous call... from (pid=17161) call /home/tpatil/recent/nova/nova/rpc.py:314
2011-03-11 15:56:56,399 DEBUG nova.rpc [-] MSG_ID is 5af3fe3eb20c47f5869fe3099c45c145 from (pid=17161) call /home/tpatil/recent/nova/nova/rpc.py:317
2011-03-11 15:56:56,683 DEBUG nova.rpc [-] Making asynchronous call... from (pid=17161) call /home/tpatil/recent/nova/nova/rpc.py:314
2011-03-11 15:56:56,684 DEBUG nova.rpc [-] MSG_ID is 5879905adc35407da03777f6bd77818a from (pid=17161) call /home/tpatil/recent/nova/nova/rpc.py:317
2011-03-11 15:56:57,103 DEBUG nova.virt.libvirt_conn [-] instance instance-00000001: starting toXML method from (pid=17161) to_xml /home/tpatil/recent/nova/nova/virt/libvirt_conn.py:679
2011-03-11 15:56:57,224 DEBUG nova.virt.libvirt_conn [-] instance instance-00000001: finished toXML method from (pid=17161) to_xml /home/tpatil/recent/nova/nova/virt/libvirt_conn.py:748
2011-03-11 15:56:57,264 INFO nova [-] called setup_basic_filtering in nwfilter
2011-03-11 15:56:57,264 INFO nova [-] ensuring static filters
2011-03-11 15:56:57,424 INFO nova [-] <nova.db.sqlalchemy.models.SecurityGroupIngressRule object at 0x96a1cec>
2011-03-11 15:56:57,424 INFO nova [-] <nova.db.sqlalchemy.models.SecurityGroupIngressRule object at 0x96a1a8c>
2011-03-11 15:56:57,438 DEBUG nova.utils [-] Running cmd (subprocess): sudo iptables-save -t filter from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,446 DEBUG nova.utils [-] Running cmd (subprocess): sudo iptables-restore from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,454 DEBUG nova.utils [-] Running cmd (subprocess): sudo iptables-save -t nat from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,460 DEBUG nova.utils [-] Running cmd (subprocess): sudo iptables-restore from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,466 DEBUG nova.utils [-] Running cmd (subprocess): sudo ip6tables-save -t filter from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,473 DEBUG nova.utils [-] Running cmd (subprocess): sudo ip6tables-restore from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:57,479 DEBUG nova.utils [-] Result was 2 from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:161
2011-03-11 15:56:57,479 DEBUG nova.utils [-] ['sudo', 'ip6tables-restore'] failed. Retrying. from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:178
2011-03-11 15:56:58,085 DEBUG nova.utils [-] Running cmd (subprocess): sudo ip6tables-restore from (pid=17161) execute /home/tpatil/recent/nova/nova/utils.py:148
2011-03-11 15:56:58,085 ERROR nova.exception [-] Uncaught exception
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/exception.py", line 120, in _wrap
(nova.exception): TRACE: return f(*args, **kw)
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/virt/libvirt_conn.py", line 407, in spawn
(nova.exception): TRACE: self.firewall_driver.prepare_instance_filter(instance)
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/virt/libvirt_conn.py", line 1252, in prepare_instance_filter
(nova.exception): TRACE: self.iptables.apply()
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/utils.py", line 524, in inner
(nova.exception): TRACE: return f(*args, **kwargs)
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/network/linux_net.py", line 302, in apply
(nova.exception): TRACE: attempts=5)
(nova.exception): TRACE: File "/home/tpatil/recent/nova/nova/utils.py", line 153, in execute
(nova.exception): TRACE: stdout=stdout, stderr=stderr, env=env)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/eventlet/green/subprocess.py", line 25, in __init__
(nova.exception): TRACE: subprocess_orig.Popen.__init__(self, args, 0, *argss, **kwds)
(nova.exception): TRACE: File "/usr/lib/python2.6/subprocess.py", line 626, in __init__
(nova.exception): TRACE: errread, errwrite) = self._get_handles(stdin, stdout, stderr)
(nova.exception): TRACE: File "/usr/lib/python2.6/subprocess.py", line 983, in _get_handles
(nova.exception): TRACE: c2pwrite = stdout.fileno()
(nova.exception): TRACE: AttributeError: 'str' object has no attribute 'fileno'
(nova.exception): TRACE:
2011-03-11 15:56:58,087 ERROR nova.compute.manager [UEGXDCVTAY-IA6K1ILRO admin admin] instance 1: Failed to spawn
(nova.compute.manager): TRACE: Traceback (most recent call last):
(nova.compute.manager): TRACE: File "/home/tpatil/recent/nova/nova/compute/manager.py", line 213, in run_instance
(nova.compute.manager): TRACE: self.driver.spawn(instance_ref)
(nova.compute.manager): TRACE: File "/home/tpatil/recent/nova/nova/exception.py", line 126, in _wrap
(nova.compute.manager): TRACE: raise Error(str(e))
(nova.compute.manager): TRACE: Error: 'str' object has no attribute 'fileno'

Related branches

Changed in nova:
assignee: nobody → Eric Windisch (ewindisch)
status: New → In Progress
Revision history for this message
Koji Iida (iida-koji) wrote :

It seems that there are two problems.

1. retry logic of utils.execute has some problem.
2. ip6tables does not have sg-fallback rule.

Please review attached patch.

Thierry Carrez (ttx)
Changed in nova:
assignee: Eric Windisch (ewindisch) → Soren Hansen (soren)
importance: Undecided → High
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
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.