Skip to content

stack --docker build fails with duplicate groupadd #3092

@dysinger

Description

@dysinger

General summary/comments (optional)

On Ubuntu Yakkety (16.10) the libvirtd group was renamed to libvirt. During the transition there are both group entries with the same gid in /etc/groups. See https://help.ubuntu.com/lts/serverguide/libvirt.html "In more recent releases (>= Yakkety) the group was renamed to libvirt. Upgraded systems get a new libvirt group with the same gid as the libvirtd group to match that."

$ cat /etc/group | grep 142
libvirtd:x:142:
libvirt:x:142:

This causes stack to issue the same two groupadd commands in a row (use --verbose to see).

Steps to reproduce

  1. Install libvirt on ubuntu 16.10
  2. Add yourself to the libvirt or libvirtd group
  3. Log out & log in or issue newgrp libvirt in a terminal
  4. Run command stack --docker build

Expected

It should work

Actual

It fails with duplicate groupadd commands and exits code 9

$ stack --docker --docker-repo xyz --verbose build
...
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.015855: [debug] Run process: /usr/sbin/groupadd -o --gid 133 group133
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.029280: [debug] Process finished in 13ms: /usr/sbin/groupadd -o --gid 133 group133
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.029628: [debug] Run process: /usr/sbin/groupadd -o --gid 134 group134
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.043260: [debug] Process finished in 13ms: /usr/sbin/groupadd -o --gid 134 group134
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.043472: [debug] Run process: /usr/sbin/groupadd -o --gid 136 group136
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.056751: [debug] Process finished in 13ms: /usr/sbin/groupadd -o --gid 136 group136
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.056990: [debug] Run process: /usr/sbin/groupadd -o --gid 142 group142
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.072685: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 142 group142
@(System/Process/Read.hs:306:3)
2017-03-28 17:52:51.072927: [debug] Run process: /usr/sbin/groupadd -o --gid 142 group142
@(System/Process/Read.hs:306:3)
Running /usr/sbin/groupadd -o --gid 142 group142 exited with ExitFailure 9


groupadd: group 'group142' already exists

Stack version

$ stack --version
Version 1.4.0, Git revision 5986498a9d1073e8d58c79ec1302bb2a7847a396 (4642 commits) x86_64 hpack-0.17.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions