Skip to content

docker-failed to start daemon: Error initializing network controller: error obtaining controller instance #1105

Open
@rfandia

Description

@rfandia
    • This is a bug report
    • This is a feature request
    • [ x]I searched existing issues before opening this one

Expected behavior

Actual behavior

Steps to reproduce the behavior

Output of docker version:

Docker version 19.03.12, build 48a66213fe

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.12
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1127.19.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.7GiB
 Name: XXXMachine
 ID: UDX4:5ZLP:Z3R5:NS3G:IPSF:4HCA:7HXQ:IRER:SV63:LJJ4:IUUW:MGGK
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.)
KVM Open Nebula - OS Centos 7

I have suddenly Docker stop working and cannot start,

Journalctl -xe

-- Unit docker.service has finished shutting down.
Sep 13 20:51:10 XXXMachine systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished shutting down.
Sep 13 20:51:10 XXXMachine systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun shutting down.
Sep 13 20:51:10 XXXMachine systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun starting up.
Sep 13 20:51:10 XXXMachine systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished starting up.

Found this at /var/log/messages

Sep 13 20:47:37 XXXMachine dockerd: time="2020-09-13T20:47:37.358504531+07:00" level=warning msg="Runnin
g modprobe bridge br_netfilter failed with message: , error: exit status 1"
Sep 13 20:47:37 XXXMachine dockerd: time="2020-09-13T20:47:37.360959332+07:00" level=warning msg="Runnin
g iptables --wait -t nat -L -n failed with message: `iptables v1.4.21: can't initialize iptables table `
nat': Table does not exist (do you need to insmod?)\nPerhaps iptables or your kernel needs to be upgrade
d.`, error: exit status 3"
Sep 13 20:47:37 XXXMachine dockerd: time="2020-09-13T20:47:37.416045671+07:00" level=info msg="stopping 
event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
Sep 13 20:47:37 XXXMachine dockerd: failed to start daemon: Error initializing network controller: error
 obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N D
OCKER: iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to ins
mod?)
Sep 13 20:47:37 XXXMachine dockerd: Perhaps iptables or your kernel needs to be upgraded.
Sep 13 20:47:37 XXXMachine dockerd: (exit status 3)

I did :
yum update -y

yum upgrade -y

Then started again docker with systemd, but same issue happen, finally I tried to reboot the VM after it, I started again
then docker went start dan run again.

Why it can be happen in my case? Please addvice.

Activity

changed the title [-]failed to start daemon: Error initializing network controller: error obtaining controller instance[/-] [+]docker-failed to start daemon: Error initializing network controller: error obtaining controller instance[/+] on Sep 13, 2020
zaGuru

zaGuru commented on Sep 14, 2020

@zaGuru

Im having the same issue? any helpers?

xalpy1337

xalpy1337 commented on Jan 12, 2021

@xalpy1337

same, help us

rfandia

rfandia commented on Jan 20, 2021

@rfandia
Author

Hi , I searched also in several documentations,
Please check your firewalld, if it stop, you could try to activated using the systemd. "systemctl start firewalld"

In my case , it dosn't work, but several documentations work with this. thanks

elfring

elfring commented on Feb 11, 2021

@elfring

🤔 How is the status for this issue together with current software functionality?

wlanboy

wlanboy commented on Mar 27, 2021

@wlanboy

If you run Debian try:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

ensure that /etc/sysctl.conf includes:
net.ipv4.ip_forward = 1

Third guess: Are you using openvpn?
If so, create the bridge yourself:
`sudo apt-get install bridge-utils

sudo brctl addbr docker0

sudo ip addr add 10.1.0.1/24 dev docker0

sudo ip link set dev docker0 up

ip addr show docker0

sudo systemctl restart docker

sudo iptables -t nat -L -n`

KRTirtho

KRTirtho commented on Sep 7, 2021

@KRTirtho

If you run Debian try:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

ensure that /etc/sysctl.conf includes:
net.ipv4.ip_forward = 1

Third guess: Are you using openvpn?
If so, create the bridge yourself:
`sudo apt-get install bridge-utils

sudo brctl addbr docker0

sudo ip addr add 10.1.0.1/24 dev docker0

sudo ip link set dev docker0 up

ip addr show docker0

sudo systemctl restart docker

sudo iptables -t nat -L -n`

I don't use any VPN so the first 2 steps worked perfectly. Thank you very much @wlanboy

seanpk

seanpk commented on Oct 21, 2021

@seanpk

For me it was the VPN issue and this solution was PFM.

Thanks @KRTirtho.

Third guess: Are you using openvpn? If so, create the bridge yourself:

sudo apt-get install bridge-utils

sudo brctl addbr docker0

sudo ip addr add 10.1.0.1/24 dev docker0

sudo ip link set dev docker0 up

ip addr show docker0

sudo systemctl restart docker

sudo iptables -t nat -L -n
Quirky-Fox

Quirky-Fox commented on May 9, 2022

@Quirky-Fox

In case someone else has a similar issue with this, while running in a Kubernetes container, I fixed this by adding capabilities to the pod:

securityContext:
capabilities:
add: ["NET_ADMIN"]

unamednada

unamednada commented on Mar 27, 2023

@unamednada

In ubuntu, just restart firewalld, it solved it for me.

hrshy0629

hrshy0629 commented on Dec 10, 2023

@hrshy0629

If you run Debian try:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
ensure that /etc/sysctl.conf includes:
net.ipv4.ip_forward = 1
Third guess: Are you using openvpn?
If so, create the bridge yourself:
sudo apt-get install bridge-utils sudo brctl addbr docker0 sudo ip addr add 10.1.0.1/24 dev docker0 sudo ip link set dev docker0 up ip addr show docker0 sudo systemctl restart docker sudo iptables -t nat -L -n

I don't use any VPN so the first 2 steps worked perfectly. Thank you very much @wlanboy

Great, it is solved for me!

Thiagolemos1995

Thiagolemos1995 commented on Jan 24, 2024

@Thiagolemos1995

If you run Debian try:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
ensure that /etc/sysctl.conf includes:
net.ipv4.ip_forward = 1
Third guess: Are you using openvpn?
If so, create the bridge yourself:
sudo apt-get install bridge-utils sudo brctl addbr docker0 sudo ip addr add 10.1.0.1/24 dev docker0 sudo ip link set dev docker0 up ip addr show docker0 sudo systemctl restart docker sudo iptables -t nat -L -n

I don't use any VPN so the first 2 steps worked perfectly. Thank you very much @wlanboy

it is solved for me to! Thankss !!

211220156

211220156 commented on Apr 5, 2024

@211220156

same, thank you so much!!

If you run Debian try: sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

ensure that /etc/sysctl.conf includes: net.ipv4.ip_forward = 1

Third guess: Are you using openvpn? If so, create the bridge yourself: `sudo apt-get install bridge-utils

sudo brctl addbr docker0

sudo ip addr add 10.1.0.1/24 dev docker0

sudo ip link set dev docker0 up

ip addr show docker0

sudo systemctl restart docker

sudo iptables -t nat -L -n`

kaspar-p

kaspar-p commented on May 25, 2024

@kaspar-p

This didn't work for me, but I had a problem of conflicting installs. On Raspbian, I had apt-get install docker and snap install docker, and this error went away when I uninstalled both and reinstalled only the snap.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @elfring@wlanboy@seanpk@Thiagolemos1995@kaspar-p

        Issue actions

          docker-failed to start daemon: Error initializing network controller: error obtaining controller instance · Issue #1105 · docker/for-linux