Shivansh
Shivansh

Reputation: 3544

Docker exits with a exit code on starting

As soon as I start Docker it fails to start and says:

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

When I try to run the command systemctl status docker.service, it gives me this:

 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
    shivansh@localhost:~/Documents/Huawei/pulsar/docker-files/pulsarReporting/memcached$ systemctl status docker.service
    ● docker.service - Docker Application Container Engine
       Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Tue 2016-10-25 11:10:12 IST; 13s ago
         Docs: https://docs.docker.com
      Process: 20514 ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
     Main PID: 20514 (code=exited, status=1/FAILURE)

    Oct 25 11:10:11 localhost systemd[1]: Starting Docker Application Container Engine...
    Oct 25 11:10:11 localhost docker[20514]: time="2016-10-25T11:10:11.789509056+05:30" level=info msg="[graphdriver] using prior storage driver \"aufs\""
    Oct 25 11:10:11 localhost docker[20514]: time="2016-10-25T11:10:11.914441951+05:30" level=info msg="Graph migration to content-addressability took 0.00 seconds"
    Oct 25 11:10:11 localhost docker[20514]: time="2016-10-25T11:10:11.918206945+05:30" level=info msg="Firewalld running: false"
    Oct 25 11:10:12 localhost docker[20514]: time="2016-10-25T11:10:12.697748195+05:30" level=fatal msg="Error starting daemon: Error initializing network controller: could not delete the default bridge network: network bridge has acti
    Oct 25 11:10:12 localhost systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
    Oct 25 11:10:12 localhost systemd[1]: Failed to start Docker Application Container Engine.
    Oct 25 11:10:12 localhost systemd[1]: docker.service: Unit entered failed state.
    Oct 25 11:10:12 localhost systemd[1]: docker.service: Failed with result 'exit-code'.

I do not know what the problem is here. I am using Docker on Ubuntu 16.04 (Xenial Xerus), and I am fairly new to this. I tried with restarting the system, but it does not help.

Upvotes: 1

Views: 3214

Answers (1)

VonC
VonC

Reputation: 1329812

This error comes from daemon/daemon_unix.go

// Clear stale bridge network
    if n, err := controller.NetworkByName("bridge"); err == nil {
        if err = n.Delete(); err != nil {
            return nil, fmt.Errorf("could not delete the default bridge network: %v", err)
        }
}

In your case, the full error message is:

Error starting daemon: 
Error initializing network controller: 
could not delete the default bridge network: network bridge has active endpoints

See for instance issue 18283, with a possible workaround in issue 17083

sudo rm -r /var/lib/docker/network 

Supposedly, PR 21261 solves a couple of cases that fixes the active endpoint issue during ungraceful daemon shutdown scenario.
It is only available with docker 1.12.2, so check your current docker version.

Upvotes: 1

Related Questions