Cannot connect to the Docker daemon & Sub-process /usr/bin/dpkg returned an error code (1) #26237

Closed
sososaity opened this Issue Sep 1, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@sososaity

sososaity commented Sep 1, 2016

Output of docker version:

Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.6.2
 Git commit:   b9f10c9
 Built:        Thu, 16 Jun 2016 21:17:51 +1200
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Output of docker info:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Output of systemctl status docker.service:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled
  Drop-In: /etc/systemd/system/docker.service.d
           └─docker.conf
   Active: failed (Result: exit-code) since Thu 2016-09-01 14:34:00 ICT; 14s ago
     Docs: https://docs.docker.com
  Process: 10581 ExecStart=/usr/bin/dockerd -H fd:// -D --tls=true --tlscert=/var/dock
 Main PID: 10581 (code=exited, status=203/EXEC)

Sep 01 14:34:00 ubuntu systemd[1]: Starting Docker Application Container Engine...
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Main process exited, code=exited, s
Sep 01 14:34:00 ubuntu systemd[1]: Failed to start Docker Application Container Engine
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Unit entered failed state.
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.

Output of systemctl status journalctl -xe:

Sep 01 14:33:44 ubuntu audit: CWD cwd="/var/lib/docker"
Sep 01 14:33:44 ubuntu audit: PATH item=0 name="/usr/bin/docker" inode=17303833 dev=fc
Sep 01 14:33:44 ubuntu audit: PATH item=1 name="/lib64/ld-linux-x86-64.so.2" inode=175
Sep 01 14:33:44 ubuntu audit: PROCTITLE proctitle=646F636B6572007073
Sep 01 14:33:49 ubuntu audit[10520]: SYSCALL arch=c000003e syscall=59 success=yes exit
Sep 01 14:33:49 ubuntu audit: EXECVE argc=2 a0="docker" a1="images"
Sep 01 14:33:49 ubuntu audit: CWD cwd="/var/lib/docker"
Sep 01 14:33:49 ubuntu audit: PATH item=0 name="/usr/bin/docker" inode=17303833 dev=fc
Sep 01 14:33:49 ubuntu audit: PATH item=1 name="/lib64/ld-linux-x86-64.so.2" inode=175
Sep 01 14:33:49 ubuntu audit: PROCTITLE proctitle=646F636B657200696D61676573
Sep 01 14:34:00 ubuntu 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 01 14:34:00 ubuntu 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.
-- 
-- The start-up result is done.
Sep 01 14:34:00 ubuntu systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
Sep 01 14:34:00 ubuntu systemd[10581]: docker.service: Failed at step EXEC spawning /u
-- Subject: Process /usr/bin/dockerd could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The process /usr/bin/dockerd could not be executed and failed.
-- 
-- The error number returned by this process is 2.
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Main process exited, code=exited, s
Sep 01 14:34:00 ubuntu systemd[1]: Failed to start Docker Application Container Engine
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Sep 01 14:34:00 ubuntu audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Unit entered failed state.
Sep 01 14:34:00 ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.

Output of uname -a:

ot@ubuntu:/var/lib/docker# uname -a
Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Additional environment details (AWS, VirtualBox, physical, etc.):

Steps to reproduce the issue:

  1. apt-get install docker.io
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)
  1. docker ps -a
An error occurred trying to connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.23/containers/json: read unix @->/var/run/docker.sock: read: connection reset by peer

Additional information you deem important (e.g. issue happens only occasionally):

@sososaity

This comment has been minimized.

Show comment
Hide comment
@sososaity

sososaity Sep 1, 2016

////////////////////
// Solution
////////////////////

  1. create a new file /etc/systemd/system/docker.service.d/overlay.conf with the following content:
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// -s overlay
  1. flush changes by executing
    sudo systemctl daemon-reload
  2. verify that the configuration has been loaded:
    systemctl show --property=ExecStart docker
  3. restart docker:
    sudo systemctl restart docker

sososaity commented Sep 1, 2016

////////////////////
// Solution
////////////////////

  1. create a new file /etc/systemd/system/docker.service.d/overlay.conf with the following content:
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// -s overlay
  1. flush changes by executing
    sudo systemctl daemon-reload
  2. verify that the configuration has been loaded:
    systemctl show --property=ExecStart docker
  3. restart docker:
    sudo systemctl restart docker

@sososaity sososaity closed this Sep 1, 2016

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