IPv6 disabled on my computer but docker network seems looking for it

Following the update Docker-ce from 20.10.5 to 20.10.6, I was no longer able to start my containers that use network.

I’m using Ubuntu 20.04 and the official docker repository.
In my syslog I got this message:
dockerd: time="2021-04-12T19:09:21.964156271-04:00" level=error msg="failed to start container" container=[number removed] error="driver failed programming external connectivity on endpoint tvheadend ([number removed]): Error starting userland proxy: listen tcp6 [::]:9982: socket: address family not supported by protocol"

The IPv6 is not enabled on my computer. I disabled the IPv6 at the kernel boot up (in the grub config file).
I don’t need and I don’t want to use IPv6 for many reasons.

I tried to uninstall docker, deleted config files, flushed images and containers, reinstalled everything and nothing worked.
I tried many settings, and nothing still worked

So, my solution (temporary I hope) was to downgrade to previous version 20.10.5 and all my containers have re-started as expected.

I took a quick look to the release note for version 20.10.6 and I see that some changes was occurred related to IPv6 networking but I don’t know how to fix my issue.

Someone can help me to configure Docker to ignore IPv6?

Thanks!!!

1 Like

@lavoiejc Can you share the steps to downgrad docker to the previous version? I am running into the same issue.

You computer is Windows or Linux (Debian flavour)?

I am on Linux (Ubuntu). I was able to figure it out and roll back to v20.10.5

I have this problem as well. Ubuntu 18.04 with ipv6 disabled (ipv6.disable=1 in /etc/default/grub)

Since the update to 20.10.6, I can no longer use docker because it complains as such:

Error starting userland proxy: listen tcp6 [::]:5432: socket: address family not supported by protocol

Until docker fixes this issue, I have to rollback to 20.10.5 like this:

apt install docker-ce=5:20.10.5~3-0~ubuntu-bionic

You might also want to “hold” the package for now

apt-mark hold docker-ce

1 Like

I too encountered this same problem today, after a package upgrade from 5:20.10.5~3-0~ubuntu-bionic to 5:20.10.6~3-0~ubuntu-bionic. I too have ipv6 disabled in the kernel:

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.15.0-112-generic root=/dev/mapper/main-root ro ipv6.disable=1 nomdmonddf nomdmonisw cgroup_enable=memory swapaccount=1

And downgrading docker-ce and docker-ce-cli got rid of the problem for the moment.

OK, my site did not survive an apt update/upgrade due to this weirdness. I am running an Ubuntu 18.04 site with IPv6 disabled and this was a breaking change for the site.

Oh, and by the way, the solution suggested by @jflambert (rollback) worked for me.

2 Likes

Yes, I realize what folks are trying to do here (i.e., get it working while having IPv6 disabled). I also had this problem with IPv6 disabled. I relented and re-enabled IPv6 and resolved my issues starting my containers. I look forward to Docker fixing this problem because I don’t want IPv6 enabled.

CentOS 7

Docker version 20.10.6, build 370c289

I try to run image like this:

docker run -d --name sonarqube -p 9000:9000 -v sonarqube-conf:/opt/sonarqube/conf -v sonarqube-data:/opt/sonarqube/data -v sonarqube-logs:/opt/sonarqube/logs -v sonarqube-extensions:/opt/sonarqube/extensions sonarqube

But get error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint sonarqube (1c38aa578b2165768b31fa28f1da1d43605627ee2d76b8b8fe9b960be6794901): Error starting userland proxy: listen tcp6 [::]:9000: socket: address family not supported by protocol.

Thanks a lot for sharing, @jflambert, this perfecty solved it for me in the meantime!

I found solution for CentOS 7

Install Docker ver 20.10.5

E.g. from repo:

sudo yum install docker-ce-20.10.5 docker-ce-cli-20.10.5 containerd.io

The corresponding issue on GitHub is this: Docker 20.10.6: all containers stopped and cannot start if ipv6 is disabled on host · Issue #42288 · moby/moby · GitHub

1 Like

Try this:

$ docker run --rm -d -p 0.0.0.0:8080:80 nginx:latest

Make it explicit which interface address you want to use.

1 Like

I tried to do its equivalent in my docker-compose file and it showed me an error message.

I can confirm that rolling back to 20.10.5 resolves this issue.
For those interested in the steps to roll back, I’ve included them below. These are the steps I followed, perhaps there are more efficient or elegant methods.

In short you will first “blacklist” the 20.10.6 version, then remove docker-ce and related packages and finally re-install docker. Due to the blacklist, the last step will install the 20.10.5 version (at the time of writing).
When later 20.10.7 comes out you should be able to run apt upgrade without an issue (not tested myself).

Find the exact version name to exclude
This command lists all versions of docker-ce that the apt command can install.

 sudo apt-cache madison docker-ce

You’re looking for the string in the second column, looking something like 5:20.10.6~3-0~ubuntu-focal.

Configure apt to ignore version 20.10.6
There are different methods, I chose apt pin using preference files.
Below commands are specifically for Ubuntu Focal, in the previous command you can find
the version string that is applicable in your case. Replace the string 5:20.10.6~3-0~ubuntu-focal accordingly.
You probably need root access to write to /etc/apt/preferences.d/

echo -e "Package: docker-ce\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce
echo -e "Package: docker-ce-rootless-extras\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce-rootless-extras
echo -e "Package: docker-ce-cli\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce-cli

Stop docker

sudo systemctl stop docker

Remove docker-ce and related from your system

sudo apt remove "^docker-ce.*"

This allows you confirm if the pins set earlier are in effect

sudo apt-cache policy "^docker-ce.*"

This should show for docker-ce, docker-ce-rootless-extras and docker-ce-cli that version 20.10.6 has a priority of -10, while other version have a positive number, e.g. 500.

Install docker again.
This should also install the required components. Note that it should install 20.10.5.
If not, I don’t know what went wrong.

sudo apt install docker-ce

Reboot
I tried simply restarting the service, but that gave me errors.
After a reboot (sudo reboot) the docker service was started and I could expose ports again without having to do any other workarounds.

This solution worked for me at the moment. Thank you

I have same problem with Docker 19.03 on CentOS 7.9
“ip addr li | grep inet6” shows no output as confirmation that IPv6 has been disabled.

Looks like this will be fixed in 20.10.7 (hopefully, anyway)

1 Like