Network Worker crashes on start with Eventlet Error

Asked by Antony Messerli

Running trunk of nova, I get this traceback immediately on starting the network worker:
2011-02-15 21:39:18,111 CRITICAL nova.root [-] f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
(nova.root): TRACE: Traceback (most recent call last):
(nova.root): TRACE: File "bin/nova-network", line 44, in <module>
(nova.root): TRACE: service.serve()
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 231, in serve
(nova.root): TRACE: x.start()
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 81, in start
(nova.root): TRACE: self.manager.init_host()
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 470, in init_host
(nova.root): TRACE: super(VlanManager, self).init_host()
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 124, in init_host
(nova.root): TRACE: self.driver.init_host()
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 118, in init_host
(nova.root): TRACE: check_exit_code=False)
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 383, in _execute
(nova.root): TRACE: return utils.execute(cmd, *args, **kwargs)
(nova.root): TRACE: File "/root/openstack/blah/nova/nova/utils.py", line 133, in execute
(nova.root): TRACE: stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
(nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/green/subprocess.py", line 31, in __init__
(nova.root): TRACE: wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
(nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/greenio.py", line 386, in __init__
(nova.root): TRACE: raise TypeError('f(ile) should be int, str, unicode or file, not %r' % f)
(nova.root): TRACE: TypeError: f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
(nova.root): TRACE:

It appears to have been introduced in rev 674.

http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/revision/674

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

You need the new eventlet package from the ppa

On Feb 15, 2011, at 7:38 PM, Antony Messerli wrote:

> Public bug reported:
>
> Running trunk of nova, I get this traceback immediately on starting the network worker:
> 2011-02-15 21:39:18,111 CRITICAL nova.root [-] f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
> (nova.root): TRACE: Traceback (most recent call last):
> (nova.root): TRACE: File "bin/nova-network", line 44, in <module>
> (nova.root): TRACE: service.serve()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 231, in serve
> (nova.root): TRACE: x.start()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 81, in start
> (nova.root): TRACE: self.manager.init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 470, in init_host
> (nova.root): TRACE: super(VlanManager, self).init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 124, in init_host
> (nova.root): TRACE: self.driver.init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 118, in init_host
> (nova.root): TRACE: check_exit_code=False)
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 383, in _execute
> (nova.root): TRACE: return utils.execute(cmd, *args, **kwargs)
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/utils.py", line 133, in execute
> (nova.root): TRACE: stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
> (nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/green/subprocess.py", line 31, in __init__
> (nova.root): TRACE: wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
> (nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/greenio.py", line 386, in __init__
> (nova.root): TRACE: raise TypeError('f(ile) should be int, str, unicode or file, not %r' % f)
> (nova.root): TRACE: TypeError: f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
> (nova.root): TRACE:
>
> It appears to have been introduced in rev 674.
>
> http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/revision/674
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/719765
>
> Title:
> Network Worker crashes on start with Eventlet Error
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> Running trunk of nova, I get this traceback immediately on starting the network worker:
> 2011-02-15 21:39:18,111 CRITICAL nova.root [-] f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
> (nova.root): TRACE: Traceback (most recent call last):
> (nova.root): TRACE: File "bin/nova-network", line 44, in <module>
> (nova.root): TRACE: service.serve()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 231, in serve
> (nova.root): TRACE: x.start()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/service.py", line 81, in start
> (nova.root): TRACE: self.manager.init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 470, in init_host
> (nova.root): TRACE: super(VlanManager, self).init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/manager.py", line 124, in init_host
> (nova.root): TRACE: self.driver.init_host()
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 118, in init_host
> (nova.root): TRACE: check_exit_code=False)
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/network/linux_net.py", line 383, in _execute
> (nova.root): TRACE: return utils.execute(cmd, *args, **kwargs)
> (nova.root): TRACE: File "/root/openstack/blah/nova/nova/utils.py", line 133, in execute
> (nova.root): TRACE: stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
> (nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/green/subprocess.py", line 31, in __init__
> (nova.root): TRACE: wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
> (nova.root): TRACE: File "/usr/local/lib/python2.6/dist-packages/eventlet-0.9.14-py2.6.egg/eventlet/greenio.py", line 386, in __init__
> (nova.root): TRACE: raise TypeError('f(ile) should be int, str, unicode or file, not %r' % f)
> (nova.root): TRACE: TypeError: f(ile) should be int, str, unicode or file, not <open GreenPipe '<fd:4>', mode 'wb' at 0x248db00>
> (nova.root): TRACE:
>
> It appears to have been introduced in rev 674.
>
> http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/revision/674
>
>

Revision history for this message
Kost (kost-isi) said :
#2

I had this error as well. The fix is:

sudo apt-get update
sudo apt-get install python-eventlet
sudo service nova-network start
ps -ef | grep nova-network
nova 3064 1 0 09:32 ? 00:00:00 su -c nova-network --flagfile=/etc/nova/nova.conf nova
nova 3071 3064 12 09:32 ? 00:00:00 /usr/bin/python /usr/bin/nova-network --flagfile=/etc/nova/nova.conf
root 3140 3563 0 09:33 pts/0 00:00:00 grep --color=auto nova-network

Revision history for this message
Christian Berendt (berendt) said :
#3

for users of other distributions:

you have to apply this patch to python-eventlet:

Description: Prevent subprocess module from rewrapping GreenPipes
Author: Soren Hansen <email address hidden>
Forwarded: https://bitbucket.org/which_linden/eventlet/issue/77/subprocess-module-fails-if-os-module-is
Last-Update: 2011-02-14

Index: python-eventlet-0.9.14/eventlet/green/subprocess.py
===================================================================
--- python-eventlet-0.9.14.orig/eventlet/green/subprocess.py 2011-02-14 11:31:39.917609581 +0100
+++ python-eventlet-0.9.14/eventlet/green/subprocess.py 2011-02-14 11:31:45.767618158 +0100
@@ -27,7 +27,7 @@
             # eventlet.processes.Process.run() method.
             for attr in "stdin", "stdout", "stderr":
                 pipe = getattr(self, attr)
- if pipe is not None:
+ if pipe is not None and not type(pipe) == greenio.GreenPipe:
                     wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
                     setattr(self, attr, wrapped_pipe)
         __init__.__doc__ = subprocess_orig.Popen.__init__.__doc__

Revision history for this message
Thierry Carrez (ttx) said :
#4

See above

Can you help with this problem?

Provide an answer of your own, or ask Antony Messerli for more information if necessary.

To post a message you must log in.