docker.io install fails when docker group exists

Bug #1769911 reported by Michał Denkiewicz on 2018-05-08
54
This bug affects 6 people
Affects Status Importance Assigned to Milestone
docker.io (Debian)
Fix Released
Unknown
docker.io (Ubuntu)
High
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned

Bug Description

[impact]
installation of docker can fail trying to create the docker group if it already exists

[test case]
# addgroup docker
# apt install docker.io

[regression potential]
The change to fix this but is small and clear: https://github.com/tianon/debian-docker/commit/16b582b497a35324246fbb203f2e094d944445ec

Also we don't care much about regressions in docker.io! https://wiki.ubuntu.com/DockerUpdates

[original description]

After installing nvidia-docker

ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: docker.io 17.12.1-0ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
Date: Tue May 8 16:22:53 2018
ErrorMessage: installed docker.io package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2018-05-07 (0 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
Python3Details: /usr/bin/python3.6, Python 3.6.5, python3-minimal, 3.6.5-3
PythonDetails: /usr/bin/python2.7, Python 2.7.15rc1, python-minimal, 2.7.15~rc1-1
RelatedPackageVersions:
 dpkg 1.19.0.5ubuntu2
 apt 1.6.1
SourcePackage: docker.io
Title: package docker.io 17.12.1-0ubuntu1 failed to install/upgrade: installed docker.io package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Michał Denkiewicz (michade) wrote :
Joshua Powers (powersj) wrote :

From terminal log:

addgroup: The group `docker' already exists and is not a system group. Exiting.

Joshua Powers (powersj) wrote :

I've seen this come up a number of times and I do not recall what the original issue was that leaves a 'docker' group around that eventually collides with the install. If the group already exists, I would assume that the install should not die, but continue on.

Changed in docker.io (Ubuntu):
status: New → Confirmed
importance: Undecided → High
summary: - package docker.io 17.12.1-0ubuntu1 failed to install/upgrade: installed
- docker.io package post-installation script subprocess returned error
- exit status 1
+ docker.io install fails when docker group exists
Andreas Hasenack (ahasenack) wrote :

Probably caused by people aborting an installation attempt due to https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1628053 and then trying again, but by then the group already exists. Just an idea, I haven't debugged it.

Steve Beattie (sbeattie) wrote :

Debian fixed this issue in 18.03.1+dfsg1-3 with the following: https://salsa.debian.org/docker-team/docker/commit/46b44b63332486dbd7b84e2be1029dc40e182410

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 18.06.1-0ubuntu1

---------------
docker.io (18.06.1-0ubuntu1) cosmic; urgency=medium

  * Update to 18.06.1 upstream release (LP: #1794396)
    - drop "fix-btrfs-constants.patch" (applied upstream)
  * Update debconf to prompt more aggressively (LP: #1784602)
    1. does not prompt on initial install (but does start the daemon)
    2. does prompt on every reinstall / upgrade (if the daemon is running)
    3. does prompt during "dpkg-reconfigure docker.io" (but does _not_
       [re]start the daemon)
    4. works properly with DEBIAN_FRONTEND=noninteractive -- user's
       previous/stored answer to the question automatically applies with no
       prompt
  * Check if "docker" group exists before creating it (LP: #1769911)

 -- Tianon Gravi <email address hidden> Mon, 24 Sep 2018 15:42:19 -0700

Changed in docker.io (Ubuntu):
status: Confirmed → Fix Released
Changed in docker.io (Ubuntu Xenial):
status: New → Triaged
Changed in docker.io (Ubuntu Bionic):
status: New → Fix Committed
description: updated
Changed in docker.io (Debian):
status: Unknown → Fix Released

Hello Michał, or anyone else affected,

Accepted docker.io into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/docker.io/18.06.1-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in docker.io (Ubuntu Bionic):
status: Fix Committed → Fix Released
Changed in docker.io (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-xenial
tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Brian Murray (brian-murray) wrote :

Hello Michał, or anyone else affected,

Accepted docker.io into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/docker.io/18.06.1-0ubuntu1~16.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-xenial
removed: verification-done-xenial
Michael Hudson-Doyle (mwhudson) wrote :
Download full text (5.4 KiB)

reverified on xenial:

root@xenial:~# apt-get purge -y docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils cgroupfs-mount libfreetype6 libltdl7 pigz ubuntu-fan
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  docker.io*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 197 MB disk space will be freed.
(Reading database ... 39634 files and directories currently installed.)
Removing docker.io (18.06.1-0ubuntu1~16.04.2) ...
'/usr/share/docker.io/contrib/nuke-graph-directory.sh' -> '/var/lib/docker/nuke-graph-directory.sh'
Purging configuration files for docker.io (18.06.1-0ubuntu1~16.04.2) ...

Nuking /var/lib/docker ...
  (if this is wrong, press Ctrl+C NOW!)

+ sleep 10

+ rm -rf /var/lib/docker/builder /var/lib/docker/buildkit /var/lib/docker/containerd /var/lib/docker/containers /var/lib/docker/image /var/lib/docker/network /var/lib/docker/nuke-graph-directory.sh /var/lib/docker/plugins /var/lib/docker/runtimes /var/lib/docker/swarm /var/lib/docker/tmp /var/lib/docker/trust /var/lib/docker/vfs /var/lib/docker/volumes
dpkg: warning: while removing docker.io, directory '/etc/docker' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...
root@xenial:~# delgroup docker
Removing group `docker' ...
Done.
root@xenial:~# addgroup docker
Adding group `docker' (GID 1001) ...
Done.
root@xenial:~# apt-get install docker.io/xenial-updates
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '17.03.2-0ubuntu2~16.04.1' (Ubuntu:16.04/xenial-updates [amd64]) for 'docker.io'
The following packages were automatically installed and are no longer required:
  libfreetype6 libltdl7 pigz
Use 'apt autoremove' to remove them.
Suggested packages:
  aufs-tools debootstrap docker-doc rinse zfs-fuse | zfsutils
The following NEW packages will be installed:
  docker.io
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/17.1 MB of archives.
After this operation, 90.2 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package docker.io.
(Reading database ... 39432 files and directories currently installed.)
Preparing to unpack .../docker.io_17.03.2-0ubuntu2~16.04.1_amd64.deb ...
Unpacking docker.io (17.03.2-0ubuntu2~16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu21.10) ...
Setting up docker.io (17.03.2-0ubuntu2~16.04.1) ...
addgroup: The group `docker' already exists and is not a system group. Exiting.
dpkg: error processing package docker.io (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu21.10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@xenial:~# apt-get purge -y docker.io
Reading package lists......

Read more...

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial

The verification of the Stable Release Update for docker.io has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 18.06.1-0ubuntu1~16.04.2

---------------
docker.io (18.06.1-0ubuntu1~16.04.2) xenial; urgency=medium

  * d/tests/docker-in-lxd: Increase timeout passed to lxd waitready.

docker.io (18.06.1-0ubuntu1~16.04.1) xenial; urgency=medium

  * Backport to Xenial (LP: #1794396). Includes fixes for
    - "No option to configure docker.io for restart on package upgrade"
      (LP: #1784602)
    - "docker.io install fails when docker group exists" (LP: #1769911)
  * Revert "Let dh_systemd install .service file: replace .install file entry
    with symlink".
  * Build with the freshly backported golang-1.10-go package.
  * Relax the build dependency on debhelper.
  * Build depend on btrfs-tools, not libbtrfs-dev or btrfs-progs.
  * Re-add build-depends on dh-systemd.

 -- Michael Hudson-Doyle <email address hidden> Mon, 12 Nov 2018 10:53:22 +1300

Changed in docker.io (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.