containers / containers/toolbox
Container doesn't start because user.Current() fails inside the entry point
- Dominant language
- Go
- Stars
- 3.5k
- Forks
- 262
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
**Describe the bug**
When trying to enter the container `fedora-toolbox-35` created using
```shell
toolbox create --distro fedora --release 35
```
I get the error
```shell
$ toolbox enter fedora-toolbox-35
Error: invalid entry point PID of container fedora-toolbox-35
```
To have a better error message I tried to attach to the container using `podman` instead of `toolbox` and got the error:
```shell
$ podman start --attach --interactive fedora-toolbox-35
Error: failed to get the current user: user: lookup userid 0: invalid argument
```
This error is returned by `toolbox` whenever Golang's `user.Current()` [gets an error when calling `getpwuid_r`](https://github.com/containers/toolbox/blob/73c53a347b402748b6a12ef9f74cecb7e8528c38/src/cmd/root.go#L316).
**Steps how to reproduce the behaviour**
1. toolbox create --distro fedora --release 35
2. toolbox enter fedora-toolbox-35
**Expected behaviour**
toolbox should start the default user shell inside a container.
**Actual behaviour**
toolbox exits with error code `1` and prints the error `Error: invalid entry point PID of container fedora-toolbox-35`.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Output of `toolbox --version` (v0.0.90+)**
```
toolbox version 0.0.99.3
```
**Toolbox package info (`rpm -q toolbox`)**
```
toolbox-0.0.99.3-2.fc34.x86_64
```
**Output of `podman version`**
```
Version: 3.4.2
API Version: 3.4.2
Go Version: go1.16.8
Built: Sun Nov 14 00:16:48 2021
OS/Arch: linux/amd64
```
**Podman package info (`rpm -q podman`)**
```
podman-3.4.2-1.fc34.x86_64
```
**Info about your OS**
Fedora Silverblue 34
**Additional context**
Add any other context about the problem here.
When did the issue start occurring? After an update (what packages were updated)?
If the issue is about operating with containers/images (creating, using, deleting,..), share here what image you used. If you're unsure, share here the output of `toolbox list -i` (shows all toolbox images on your system).
```
IMAGE ID IMAGE NAME CREATED
ab8bc106d4a7 2 months ago
d8a734db8c5c registry.fedoraproject.org/fedora-toolbox:34 7 months ago
40b181c70b73 registry.fedoraproject.org/fedora-toolbox:35 4 weeks ago
```
If you see an error message saying: `Error: invalid entry point PID of container `, add to the ticket output of command `podman start --attach `.
Contributor guide
Research direction
Start by reproducing the failure with `toolbox create --distro fedora --release 35` and `toolbox enter fedora-toolbox-35`, then inspect `src/cmd/root.go` around the `user.Current()` call. Compare the toolbox and Podman errors and trace the entry-point handling. Done means the Fedora toolbox starts the default user shell instead of exiting with the invalid entry point error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fedora, go, linux
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100