commercialhaskell / commercialhaskell/stack
Can't attach to docker container after build: `groupadd: group 'group3' already exists`
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### Steps to reproduce
1. `stack new test-proj simple`
2. `cd test-proj`
3. append the following to `stack.yaml`
```
docker:
enable: true
persist: true
detach: true
```
4. `stack build --docker-container-name test-cont`
5. `docker container start -i test-cont`
### Expected
Get access to the docker container shell
### Actual
`docker container start -i test-cont` exited with the following error:
```
Received ExitFailure 9 when running
Raw command: /usr/sbin/groupadd -o --gid 3 group3
Standard error:
groupadd: group 'group3' already exists
```
### Stack version
```
$ stack --version
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2
```
### Method of installation
This AUR package: https://aur.archlinux.org/packages/stack-static
### System information
```
$ uname -a
Linux pc 4.19.85-1-MANJARO #1 SMP PREEMPT Thu Nov 21 10:38:39 UTC 2019 x86_64 GNU/Linux
$ docker --version
Docker version 19.03.4-ce, build 9013bf583a
```
### Related issues
Very similar error, but a patch was merged: https://github.com/commercialhaskell/stack/issues/3092
Contributor guide
Research direction
Reproduce the failure with the listed stack.yaml settings and the stack build and docker container start commands. Compare the behavior with related issue #3092, then trace the Docker container setup responsible for running groupadd. Done means the container starts interactively without the existing-group error and the behavior is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, haskell
- Domain
- devops, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100