Skip to content

Instantly share code, notes, and snippets.

@wizardfrag
Created March 10, 2016 17:16
Show Gist options
  • Save wizardfrag/9e160528e1e3250faf68 to your computer and use it in GitHub Desktop.
Save wizardfrag/9e160528e1e3250faf68 to your computer and use it in GitHub Desktop.
CalledProcessError: Command '['/var/lib/cattle/config.sh', u'host-iptables']' returned non-zero exit status 254
2016-03-10 17:11:40,940 ERROR cattle [139660519961616] [utils.py:284] Failed to call (['/var/lib/cattle/config.sh', u'host-iptables'],) {'stderr': -2, 'cwd': '/var/lib/cattle', 'env': {'CATTLE_STATE_DIR': '/var/lib/rancher/state', 'CATTLE_SYSTEMD': 'true', 'HOME': '/root', 'CATTLE_CADVISOR_WRAPPER': 'cadvisor.sh', 'AGENT_PARENT_PID': '16859', 'CATTLE_AGENT_PIDNS': 'host', 'CATTLE_URL': 'http://rancher.minechasm.net/v1', 'SHLVL': '1', 'CATTLE_AGENT_LOG_FILE': '/var/log/rancher/agent.log', 'CATTLE_AGENT_IP': '163.172.130.239', 'RANCHER_AGENT_IMAGE': 'rancher/agent:v0.9.2', 'AGENT_CONF_FILE': '/var/lib/rancher/etc/agent.conf', 'CATTLE_ACCESS_KEY': '7D4A2A65B351BB9822D9', 'PATH': '/var/lib/cattle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'CA_CERT_FILE': '/var/lib/rancher/etc/ssl/ca.crt', 'CATTLE_STORAGE_URL': 'http://rancher.minechasm.net/v1', 'CATTLE_CONFIG_URL': 'http://rancher.minechasm.net/v1', 'HOST_DOCKER_SOCK': '/var/run/docker.sock', 'OLDPWD': '/tmp', 'HOSTNAME': 'asgard', 'PWD': '/var/lib/cattle/pyagent', 'CATTLE_SECRET_KEY': 'dcEmzpzaLSVr8isCPwU22HkFSZ33aRRGi77wfFmm', 'CATTLE_HOME': '/var/lib/cattle'}}, exit [254], output :
INFO: Updating host-iptables
INFO: Downloading http://rancher.minechasm.net/v1//configcontent//host-iptables current=
INFO: Running /var/lib/cattle/download/host-iptables/host-iptables-2-c4ff6e2a9b13d7c677ac3988cfb14efa27c956af435a9ec8e2727bd575a5ada0/apply.sh
RTNETLINK answers: Operation not supported
Dump terminated
RTNETLINK answers: Operation not supported
[[scripts.sh:184] script_env
[[scripts.sh:109] '[' -n http://rancher.minechasm.net/v1 ']'
[[scripts.sh:110] return
[[scripts.sh:186] export CATTLE_HOME=/var/lib/cattle
[[scripts.sh:186] CATTLE_HOME=/var/lib/cattle
[[scripts.sh:187] export CATTLE_CONFIG_URL=http://rancher.minechasm.net/v1
[[scripts.sh:187] CATTLE_CONFIG_URL=http://rancher.minechasm.net/v1
[[scripts.sh:188] export CATTLE_STORAGE_URL=http://rancher.minechasm.net/v1
[[scripts.sh:188] CATTLE_STORAGE_URL=http://rancher.minechasm.net/v1
[apply.sh:5] BRIDGE=docker0
[apply.sh:6] docker-1.9 version
[[apply.sh:7] docker-1.9 network inspect bridge
[[apply.sh:7] jq -r '.[0].Options["com.docker.network.bridge.name"]'
[apply.sh:7] BRIDGE=docker0
[apply.sh:8] ip link show dev docker0
[[apply.sh:13] iptables-save
[[apply.sh:13] grep -E -- '-A POSTROUTING.* -o docker0 -j MASQUERADE'
[[apply.sh:13] sed 's/-A POSTROUTING //'
[apply.sh:13] MASQ='-s 172.17.0.0/16 ! -o docker0 -j MASQUERADE'
[apply.sh:15] '[' -n '-s 172.17.0.0/16 ! -o docker0 -j MASQUERADE' ']'
[apply.sh:16] cat
[apply.sh:20] sed -i '/#POSTRULES/r masq-rules' content-home/etc/cattle/host-iptables
[apply.sh:23] sed -i 's/%BRIDGE%/! -i docker0/g' content-home/etc/cattle/host-iptables
[apply.sh:25] apply_config iptables-restore -n etc/cattle/host-iptables
[scripts.sh:147] local file=etc/cattle/host-iptables
[scripts.sh:148] local 'cmd=iptables-restore -n'
[scripts.sh:150] iptables-restore -n content-home/etc/cattle/host-iptables
[apply.sh:27] for i in PRE POST
[apply.sh:28] iptables -t nat -n -L PREROUTING
[apply.sh:28] grep -q CATTLE_PREROUTING
[apply.sh:27] for i in PRE POST
[apply.sh:28] iptables -t nat -n -L POSTROUTING
[apply.sh:28] grep -q CATTLE_POSTROUTING
[apply.sh:33] add_route_table 300
[scripts.sh:160] local id=300
[scripts.sh:161] local opts=
[scripts.sh:162] ip rule show
[scripts.sh:162] cut -f1 -d:
[scripts.sh:162] grep -q '^300$'
RTNETLINK answers: Operation not supported
Dump terminated
[scripts.sh:163] ip rule add table 300 pref 300
RTNETLINK answers: Operation not supported
Traceback (most recent call last):
File "/var/lib/cattle/pyagent/cattle/utils.py", line 280, in get_command_output
return check_output(*args, **kw)
File "/var/lib/cattle/pyagent/cattle/utils.py", line 337, in check_output
raise e1
CalledProcessError: Command '['/var/lib/cattle/config.sh', u'host-iptables']' returned non-zero exit status 254
@ricardoromanj
Copy link

Hello, I have encountered this issue as well. Have you found anything that could help resolve this? I cannot instantiate any containers with port mappings...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment