iptables being run on a nova-api server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Thierry Carrez | ||
nova (Ubuntu) |
Fix Released
|
Undecided
|
Adam Gandelman |
Bug Description
When starting nova-api I get the below error in nova-api.log
I'm running the latest packages in Ubuntu 12.04.
The server is running the following nova services:
nova-api
nova-cert
nova-scheduler
nova-consoleauth
Not sure why it is trying to do iptables commands?
Cheers,
Sam
2012-05-21 12:22:58 DEBUG nova.utils [-] Attempting to grab semaphore "iptables" for method "apply"... from (pid=27739) inner /usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] Got semaphore "iptables" for method "apply"... from (pid=27739) inner /usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] Attempting to grab file lock "iptables" for method "apply"... from (pid=27739) inner /usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] Got file lock "iptables" for method "apply"... from (pid=27739) inner /usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] Running cmd (subprocess): sudo /usr/bin/
Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] Result was 99 from (pid=27739) execute /usr/lib/
2012-05-21 12:22:58 DEBUG nova.utils [-] ['sudo', '/usr/bin/
2012-05-21 12:22:59 DEBUG nova.utils [-] Running cmd (subprocess): sudo /usr/bin/
Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib/
2012-05-21 12:22:59 DEBUG nova.utils [-] Result was 99 from (pid=27739) execute /usr/lib/
2012-05-21 12:22:59 DEBUG nova.utils [-] ['sudo', '/usr/bin/
2012-05-21 12:23:01 DEBUG nova.utils [-] Running cmd (subprocess): sudo /usr/bin/
Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib/
2012-05-21 12:23:01 DEBUG nova.utils [-] Result was 99 from (pid=27739) execute /usr/lib/
2012-05-21 12:23:01 DEBUG nova.utils [-] ['sudo', '/usr/bin/
2012-05-21 12:23:03 DEBUG nova.utils [-] Running cmd (subprocess): sudo /usr/bin/
Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib/
2012-05-21 12:23:03 DEBUG nova.utils [-] Result was 99 from (pid=27739) execute /usr/lib/
2012-05-21 12:23:03 DEBUG nova.utils [-] ['sudo', '/usr/bin/
2012-05-21 12:23:04 DEBUG nova.utils [-] Running cmd (subprocess): sudo /usr/bin/
Exception AssertionError: AssertionError() in <module 'threading' from '/usr/lib/
2012-05-21 12:23:04 DEBUG nova.utils [-] Result was 99 from (pid=27739) execute /usr/lib/
Traceback (most recent call last):
File "/usr/lib/
timer()
File "/usr/lib/
cb(*args, **kw)
File "/usr/lib/
result = function(*args, **kwargs)
File "/usr/lib/
server.start()
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
iptables_
File "/usr/lib/
retval = f(*args, **kwargs)
File "/usr/lib/
attempts=5)
File "/usr/lib/
return utils.execute(*cmd, **kwargs)
File "/usr/lib/
cmd=' '.join(cmd))
ProcessExecutio
Command: sudo /usr/bin/
Exit code: 99
Stdout: 'Unauthorized command: iptables-save -t filter\n'
Stderr: 'sudo: unable to resolve host server-3093\n'
Related branches
Changed in nova: | |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Thierry Carrez (ttx) |
importance: | Undecided → High |
tags: | added: rootwrap |
Changed in nova: | |
assignee: | Thierry Carrez (ttx) → Piotr Siwczak (psiwczak) |
Changed in nova (Ubuntu): | |
assignee: | nobody → Adam Gandelman (gandelman-a) |
status: | New → In Progress |
Changed in nova: | |
milestone: | none → folsom-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | folsom-3 → 2012.2 |
It's setting up iptables rules for the metadata service, which is considered to be a part of nova-api. I put some debugging code into the function metadata_accept and here's the rule which is set up by nova-api upon restart:
DEBUG nova.network. linux_net [-] INPUT -s 0.0.0.0/0 -d 10.0.2.15 -p tcp -m tcp --dport 8775 -j ACCEPT from (pid=18013) metadata_accept /opt/stack/ nova/nova/ network/ linux_net. py:426
But the bug is definitely there. It refers to nova-rootwrap script.
From the log you posted, it can be seen that this script fails in case of applying "iptables-save" commands. This is because nova-rootwrap uses internal filters for commands ran as root. The filters for iptables are defined here: python2. 7/dist- packages/ nova/rootwrap/ network. py
/usr/lib/
If you copy this file over to your nova-api server, the iptables should succeed.
But in general - it should not work this way - one should have a separate policy file called:
/usr/lib/ python2. 7/dist- packages/ nova/rootwrap/ api.py
There's no such file - so I guess it's reasonable to vote for a bug here!