Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Running with --user $USER in any type of user (root and non-root) yields error.
The same issue can also be reproduced with podman 2.0.6 and Crun 0.14.1
Steps to reproduce the issue:
Login as non-root user
podman run --log-level=debug --user=$USER -it bash
Describe the results you received:
DEBU[0000] ExitCode msg: "unable to find user $USER: no matching entries in passwd file"
Error: unable to find user $USER: no matching entries in passwd file
Describe the results you expected:
No error
Additional information you deem important (e.g. issue happens only occasionally):
Output of podman version:
Version: 2.1.0
API Version: 2.0.0
Go Version: go1.15
Built: Wed Sep 23 03:57:42 2020
OS/Arch: linux/ppc64le
Output of podman info --debug:
host:
arch: ppc64le
buildahVersion: 1.16.1
cgroupVersion: v2
conmon:
package: conmon-2.0.21-3.fc33.ppc64le
path: /usr/bin/conmon
version: 'conmon version 2.0.21, commit: e94ec0e8c97f6de4478c42cc51d0444cb07d7419'
cpus: 32
distribution:
distribution: fedora
version: "33"
eventLogger: journald
hostname: localhost.localdomain
idMappings:
gidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
uidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
kernel: 5.6.19-300.fc32.ppc64le
linkmode: dynamic
memFree: 53551890432
memTotal: 68112941056
ociRuntime:
name: crun
package: crun-0.14.1-5.fc33.ppc64le
path: /usr/bin/crun
version: |-
crun version 0.14.1
commit: 598ea5e192ca12d4f6378217d3ab1415efeddefa
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
os: linux
remoteSocket:
path: /run/user/1000/podman/podman.sock
rootless: true
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.1.4-1.fc33.ppc64le
version: |-
slirp4netns version 1.1.4+dev
commit: eecccdb96f587b11d7764556ffacfeaffe4b6e11
libslirp: 4.3.1
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.0
swapFree: 4294901760
swapTotal: 4294901760
uptime: 85h 47m 17.9s (Approximately 3.54 days)
registries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- registry.centos.org
- docker.io
store:
configFile: /home/tle/.config/containers/storage.conf
containerStore:
number: 7
paused: 0
running: 0
stopped: 7
graphDriverName: overlay
graphOptions:
overlay.mount_program:
Executable: /usr/bin/fuse-overlayfs
Package: fuse-overlayfs-1.1.2-1.fc33.ppc64le
Version: |-
fusermount3 version: 3.9.3
fuse-overlayfs: version 1.1.0
FUSE library version 3.9.3
using FUSE kernel interface version 7.31
graphRoot: /home/tle/.local/share/containers/storage
graphStatus:
Backing Filesystem: btrfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "false"
imageStore:
number: 1
runRoot: /run/user/1000/containers
volumePath: /home/tle/.local/share/containers/storage/volumes
version:
APIVersion: 2.0.0
Built: 1600797462
BuiltTime: Wed Sep 23 03:57:42 2020
GitCommit: ""
GoVersion: go1.15
OsArch: linux/ppc64le
Version: 2.1.0
Package info (e.g. output of rpm -q podman or apt list podman):
podman-2.1.0-1.fc33.ppc64le
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Just a physical computer.
The code is looking for $USER within the container image, if it does not exist in /etc/passwd inside of the container, then you will get this failure. I don't think this is a bug.
It works with v2.0.6 on F32 though.
Ah ... I totally agree with @rhatdan.
I just ran as root in my VM...
Note that sudo does not change $USER.