Articles in this section

Unable to start Docker service: Failed to start Docker Application Container Engine.

Plesk for Linux kb: technical Docker

Symptoms

  • Docker service fails to start

  • Running systemctl status docker returns:

    Jan 18 19:22:32 exampleserv systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
    Jan 18 19:22:32 exampleserv systemd[1]: docker.service: Failed with result 'exit-code'.
    Jan 18 19:22:32 exampleserv systemd[1]: Failed to start Docker Application Container Engine.
    Jan 18 19:22:34 exampleserv systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
    Jan 18 19:22:34 exampleserv systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
    Jan 18 19:22:34 exampleserv systemd[1]: Stopped Docker Application Container Engine.
    Jan 18 19:22:34 exampleserv systemd[1]: docker.service: Start request repeated too quickly.
    Jan 18 19:22:34 exampleserv systemd[1]: docker.service: Failed with result 'exit-code'.
    Jan 18 19:22:34 exampleserv systemd[1]: Failed to start Docker Application Container Engine.

  • Running the command dockerd -D shows the following error message:

    failed to start daemon: Error initializing network controller: error creating default "bridge" network: Failed to Setup IP tables: Unable to enable NAT rule: (COMMAND_FAILED: '/usr/sbin/iptables -w10 -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE' failed: iptables v1.8.4 (nf_tables): RULE_INSERT failed (No such file or directory): rule in chain POSTROUTING
    )

  • System log shows:

dockerd[1411794]: failed to start daemon: Error initializing network controller: error creating default "bridge" network: cannot create network 0f885fcda5151689944cd2a5b87fa7e5914daf233ec03ce2aaaa71b6a655a52b (docker0): conflicts with network 71448e4a927e0980044030bad84efaa61e0a2239cc06a3dc6784dc3f2aea4710 (docker0): networks have same bridge name

Cause

Corruption on Docker network configuration files under /var/lib/docker/network

Resolution

Recreate the network rules

  1. Connect to the server via SSH

  2. Check for iptables chains:

    # iptables -t nat -L

  3. If chain POSTROUTING exists, run the command from the error with root privileges:

    # iptables -w10 -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE

  4. Restart the Docker service:

    # systemctl start docker

If the service doesn't start and the output of the command dockerd -D changed to:

failed to start daemon: Error initializing network controller: error creating default "bridge" network: cannot create network 1cc93be12b3469e962e41ba062ba54ea89fe28aaab8bfb24bec377ca5bbf388e (docker0): conflicts with network 5cf423cbc6de0b129e559cffaf5d1b1dd8166dc393df6ad87c2dff41315e9f7b (docker0): networks have same bridge name

This error is caused by corruption of the Docker network files. To solve it:

  1. Connect to the server via SSH

  2. Move the Docker network files:

    # mv /var/lib/docker/network /var/lib/docker/network.bck

  3. Restart Docker service:

    # systemctl start docker

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.