Ubuntu 16.04.1 LTS weird error on systemctl enable docker #28781

Closed
sebamontini opened this Issue Nov 23, 2016 · 5 comments

Comments

Projects
None yet
7 participants

sebamontini commented Nov 23, 2016

I'm installing docker engine following the doc at: https://docs.docker.com/engine/installation/linux/ubuntulinux/

everything goes well, docker installs and runs properlly, except when I try to do a:
sudo systemctl enable docker

then I get this error:

Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable docker
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'docker' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `docker'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `docker'
update-rc.d: error: docker Default-Start contains no runlevels, aborting.

Steps to reproduce the issue:

  1. install docker on an Ubuntu 16.04 LTS following the doc: https://docs.docker.com/engine/installation/linux/ubuntulinux/
  2. sudo systemctl enable docker

Output of docker version:

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 21:39:03 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 21:39:03 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor
Kernel Version: 4.4.0-36-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.795 GiB
Name: ip-172-17-0-108
ID: 33XT:42QD:BEPP:GJK4:QLUR:B2SG:BUM7:ABH2:ATSL:WDXM:WODL:RTOE
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8```

**Additional environment details (AWS, VirtualBox, physical, etc.):**
EC2 instance, running the official Ubuntu 16.04 LTS AMI

@sebamontini sebamontini changed the title from Ubuntu 16.06 weird error on systemctl enable docker to Ubuntu 16.10 LTS weird error on systemctl enable docker Nov 23, 2016

@sebamontini sebamontini changed the title from Ubuntu 16.10 LTS weird error on systemctl enable docker to Ubuntu 16.04.1 LTS weird error on systemctl enable docker Nov 23, 2016

Contributor

mlaventure commented Nov 28, 2016

It looks like you have a conflict with an old upstart configuration. ubuntu switched to systemd as the init system a while back.

You may want to look around for old docker upstart script and remove them, then purge/reinstall docker. You may have to delete files that you modified manually to ensure that the correct one get reinstalled.

I ran into a similar error after upgrading a system from Ubuntu 14.04 LTS to 16.04.1 LTS and installing Docker 1.12.4. Easy if slightly time consuming to recreate.

Here's the output of systemctl enable docker.
systemctl is invoking /usr/sbin/update-rc.d in the systemd-sysv-install script and I suspect the trouble might lie somewhere in that code which thinks upstart is still installed.

machine101-root[/root]# systemctl enable docker
Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable docker
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `screen-cleanup'
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `screen-cleanup'
Member

thaJeztah commented Dec 16, 2016

It looks like Ubuntu installs packages to migrate users from SysvInit / Upstart to systemd, also see http://askubuntu.com/questions/776524/systemctl-cannot-disable-services-displays-upstart-errors, and https://wiki.ubuntu.com/SystemdForUpstartUsers

Looking at this, this doesn't look like a bug in docker, and adding additional code to take these migration scripts into account may be overreaching and out of scope for this project.

I'm closing this issue, because I don't think we can address this, but I hope the links above may help you further in finding a solution. Feel free to comment after I closed!

@thaJeztah thaJeztah closed this Dec 16, 2016

Having the same issue I realized that moving the file from /etc/init.d/ to /etc/systemd/system solved the problem

vinzBad commented Nov 16, 2017

mv /etc/init.d/screen-cleanup.dpkg-new /etc/init.d/script-cleanup as described in https://bugs.launchpad.net/ubuntu/+source/binfmt-support/+bug/1691295 fixed it for me.

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