sudo nova-rootwrap interprets arguements incorrectly

Bug #927478 reported by Paul Pettigrew
This bug report is a duplicate of:  Bug #926412: Rootwrap pid check raises exception. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

When doing an lvdisplay, nova-rootwrap tries to interpret the name of the logical volume as an integer PID. See below the example nova-volume.log output when trying to delete a Volume:

root@server:/var/log/nova# tailf nova-volume.log
2012-02-06 17:31:37,816 INFO nova.volume.manager [-] Clear capabilities
2012-02-06 17:31:37,963 ERROR nova.volume.driver [-] Recovering from a failed execute. Try number 1
(nova.volume.driver): TRACE: Traceback (most recent call last):
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/volume/driver.py", line 86, in _try_execute
(nova.volume.driver): TRACE: self._execute(*command, **kwargs)
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 232, in execute
(nova.volume.driver): TRACE: cmd=' '.join(cmd))
(nova.volume.driver): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.volume.driver): TRACE: Command: sudo nova-rootwrap lvdisplay vg_nova-volumes/volume-00000003
(nova.volume.driver): TRACE: Exit code: 1
(nova.volume.driver): TRACE: Stdout: ''
(nova.volume.driver): TRACE: Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 63, in <module>\n filtermatch = wrapper.match_filter(filters, userargs)\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/wrapper.py", line 51, in match_filter\n if f.match(userargs):\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/filters.py", line 116, in match\n pid = int(args[1])\nValueError: invalid literal for int() with base 10: \'vg_nova-volumes/volume-00000003\'\n'
(nova.volume.driver): TRACE:
2012-02-06 17:31:39,005 ERROR nova.volume.driver [-] Recovering from a failed execute. Try number 2
(nova.volume.driver): TRACE: Traceback (most recent call last):
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/volume/driver.py", line 86, in _try_execute
(nova.volume.driver): TRACE: self._execute(*command, **kwargs)
(nova.volume.driver): TRACE: File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 232, in execute
(nova.volume.driver): TRACE: cmd=' '.join(cmd))
(nova.volume.driver): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.volume.driver): TRACE: Command: sudo nova-rootwrap lvdisplay vg_nova-volumes/volume-00000003
(nova.volume.driver): TRACE: Exit code: 1
(nova.volume.driver): TRACE: Stdout: ''
(nova.volume.driver): TRACE: Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 63, in <module>\n filtermatch = wrapper.match_filter(filters, userargs)\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/wrapper.py", line 51, in match_filter\n if f.match(userargs):\n File "/usr/lib/python2.7/dist-packages/nova/rootwrap/filters.py", line 116, in match\n pid = int(args[1])\nValueError: invalid literal for int() with base 10: \'vg_nova-volumes/volume-00000003\'\n'
(nova.volume.driver): TRACE:

Revision history for this message
Paul Pettigrew (paul-pettigrew) wrote :

I forgot to add, the workaround is to change the value of "--root_helper" in nova.conf as follows (so that it is using just "sudo"):

#--root_helper=sudo nova-rootwrap
--root_helper=sudo

And place the following line in sudoers (not secure, but OK in the particular R&D I am running at the moment):
nova ALL=(ALL) NOPASSWD: ALL

This system is Ubuntu 11.10x64 running trunk PPA's.

Hoping this helps others til the guru can finalise the superior "sudo nova-rootwrap" method.

Cheers,

Paul

Revision history for this message
Paul Pettigrew (paul-pettigrew) wrote :

Thanks for joining the dots below Vish (duplicate link); sorry I was not able to when I was searching yesterday prior to lodging the bug.
Paul

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Vish Ishaya
Sent: Tuesday, 7 February 2012 2:40 AM
To: Paul Pettigrew
Subject: [Bug 927478] Re: sudo nova-rootwrap interprets arguements incorrectly

*** This bug is a duplicate of bug 926412 ***
    https://bugs.launchpad.net/bugs/926412

** This bug has been marked a duplicate of bug 926412
   Rootwrap pid check raises exception

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.