Skip to content

Exits with "unable to detect hairpin mode (is the docker daemon running?)" #67

@Rycieos

Description

@Rycieos

Version: v0.4.3 docker.
Docker version: 20.10.1 and 20.10.2
OS: CentOS Linux release 8.3.2011 (Core)

After a system update, upon launching I get this error:

$ docker logs ipv6nat
2021/01/09 17:26:57 unable to detect hairpin mode (is the docker daemon running?)

After which the container exits and restarts.

Thinking it might be a permissions issue, I removed all --cap-adds, leaving only the --cap-drop ALL to test, but that broke it more:

2021/01/09 18:07:38 running [/sbin/iptables -t nat -C OUTPUT -m addrtype --dst-type LOCAL -j DOCKER --wait]: exit status 3: addrtype: Could not determine whether revision 1 is supported, assuming it is.
addrtype: Could not determine whether revision 1 is supported, assuming it is.
iptables v1.8.4 (legacy): can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.

I then tried to give it --cap-add ALL, but that did not fix it.

Since part of the system update was docker-ce, I thought maybe it had changed the backend rules, but:

# /sbin/iptables-save -t nat
# Generated by iptables-save v1.8.4 on Sat Jan  9 13:09:03 2021
*nat
...
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
...

Clearly the right rule still exists. And checking manually:

# /sbin/iptables -t nat -C OUTPUT -m addrtype --dst-type LOCAL -j DOCKER --wait; echo "$?"
iptables: Bad rule (does a matching rule exist in that chain?).
1
# /sbin/iptables -t nat -C OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER --wait; echo "$?"
0

The actual checking commands returns correctly as expected. I am using this code section as the reference: https://github.com/robbertkl/docker-ipv6nat/blob/v0.4.3/manager.go#L79-L86

At this point I downgraded dockerd back to 20.10.1, but I got the same error.

What is strange is that when I first did the system upgrade, dockerd restarted itself as usual, and all my containers came back online with IPv6 working. It was after an OS restart that this error started.

I tried to do a system rollback, but the old package versions couldn't be found, so I'm stuck.

Full package list that I upgraded:

Package New Version Old Version
NetworkManager 1:1.26.0-12.el8_3.x86_64 1:1.26.0-9.el8_3.x86_64
NetworkManager-libnm 1:1.26.0-12.el8_3.x86_64 1:1.26.0-9.el8_3.x86_64
NetworkManager-team 1:1.26.0-12.el8_3.x86_64 1:1.26.0-9.el8_3.x86_64
NetworkManager-tui 1:1.26.0-12.el8_3.x86_64 1:1.26.0-9.el8_3.x86_64
gnutls 3.6.14-7.el8_3.x86_64 3.6.14-6.el8.x86_64
iptables 1.8.4-15.el8_3.3.x86_64 1.8.4-15.el8.x86_64
iptables-ebtables 1.8.4-15.el8_3.3.x86_64 1.8.4-15.el8.x86_64
iptables-libs 1.8.4-15.el8_3.3.x86_64 1.8.4-15.el8.x86_64
iptables-services 1.8.4-15.el8_3.3.x86_64 1.8.4-15.el8.x86_64
iwl100-firmware 39.31.5.1-101.el8_3.1.noarch 39.31.5.1-99.el8.1.noarch
iwl1000-firmware 1:39.31.5.1-101.el8_3.1.noarch 1:39.31.5.1-99.el8.1.noarch
iwl105-firmware 18.168.6.1-101.el8_3.1.noarch 18.168.6.1-99.el8.1.noarch
iwl135-firmware 18.168.6.1-101.el8_3.1.noarch 18.168.6.1-99.el8.1.noarch
iwl2000-firmware 18.168.6.1-101.el8_3.1.noarch 18.168.6.1-99.el8.1.noarch
iwl2030-firmware 18.168.6.1-101.el8_3.1.noarch 18.168.6.1-99.el8.1.noarch
iwl3160-firmware 1:25.30.13.0-101.el8_3.1.noarch 1:25.30.13.0-99.el8.1.noarch
iwl3945-firmware 15.32.2.9-101.el8_3.1.noarch 15.32.2.9-99.el8.1.noarch
iwl4965-firmware 228.61.2.24-101.el8_3.1.noarch 228.61.2.24-99.el8.1.noarch
iwl5000-firmware 8.83.5.1_1-101.el8_3.1.noarch 8.83.5.1_1-99.el8.1.noarch
iwl5150-firmware 8.24.2.2-101.el8_3.1.noarch 8.24.2.2-99.el8.1.noarch
iwl6000-firmware 9.221.4.1-101.el8_3.1.noarch 9.221.4.1-99.el8.1.noarch
iwl6000g2a-firmware 18.168.6.1-101.el8_3.1.noarch 18.168.6.1-99.el8.1.noarch
iwl6050-firmware 41.28.5.1-101.el8_3.1.noarch 41.28.5.1-99.el8.1.noarch
iwl7260-firmware 1:25.30.13.0-101.el8_3.1.noarch 1:25.30.13.0-99.el8.1.noarch
kexec-tools 2.0.20-34.el8_3.1.x86_64 2.0.20-34.el8.x86_64
linux-firmware 20200619-101.git3890db36.el8_3.noarch 20200619-99.git3890db36.el8.noarch
microcode_ctl 4:20200609-2.20201112.1.el8_3.x86_64 4:20200609-2.20201027.1.el8_3.x86_64
systemd 239-41.el8_3.1.x86_64 239-41.el8_3.x86_64
systemd-libs 239-41.el8_3.1.x86_64 239-41.el8_3.x86_64
systemd-pam 239-41.el8_3.1.x86_64 239-41.el8_3.x86_64
systemd-udev 239-41.el8_3.1.x86_64 239-41.el8_3.x86_64
tuned 2.14.0-3.el8_3.1.noarch 2.14.0-3.el8.noarch
tzdata 2020f-1.el8.noarch 2020d-1.el8.noarch
docker-ce 3:20.10.2-3.el8.x86_64 3:20.10.1-3.el8.x86_64
docker-ce-cli 1:20.10.2-3.el8.x86_64 1:20.10.1-3.el8.x86_64
docker-ce-rootless-extras 20.10.2-3.el8.x86_64 20.10.1-3.el8.x86_64

Seems like coreos/go-iptables/issues/79 could be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions