Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rootful podman with --userns=auto fails #1410

Closed
ingobecker opened this issue Oct 22, 2022 · 3 comments · Fixed by #1411
Closed

Rootful podman with --userns=auto fails #1410

ingobecker opened this issue Oct 22, 2022 · 3 comments · Fixed by #1411
Assignees
Labels

Comments

@ingobecker
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Running a certain image as a host user root with --userns=auto causes the same errors as described in containers/podman#14504 but without this option runs just fine. Other images, when run with the same option, seem to work without issues.

Steps to reproduce the issue:

# podman run --userns auto homeassistant/home-assistant:stable

Describe the results you received:

Error: crun: mkdir `secrets`: Permission denied: OCI permission denied

or

Error: crun: open `/var/lib/containers/storage/overlay/cc65e6466f2c4ef019864554561b2887ff7828ff0fa45d60606458277f4a634e/merged/.containerenv`: No such file or directory: OCI runtime attempted to invoke a command that was not found

or

Error: crun: open `/var/lib/containers/storage/overlay/d7382fd09c8bb2af8d0ba4a501c6abbd8c316fab78f69a42a9a512c14cb40eac/merged/resolv.conf`: No such file or directory: OCI runtime attempted to invoke a command that was not found

Describe the results you expected:
The image should run without any errors, just like running it without --userns=auto.

Additional information you deem important (e.g. issue happens only occasionally):
The exact digest of the images is 97469ad6347a2173d524c8c581c4ec97ba2f0349a96bd878b67767cd4fba4820.
The errors occur in no particular order.

Output of podman version:

Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.5
Built:        Wed Sep  7 19:58:19 2022
OS/Arch:      linux/amd64

Output of podman info:

host:
  arch: amd64
  buildahVersion: 1.27.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.4-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.4, commit: '
  cpuUtilization:
    idlePercent: 99.29
    systemPercent: 0.22
    userPercent: 0.5
  cpus: 1
  distribution:
    distribution: fedora
    variant: coreos
    version: "36"
  eventLogger: journald
  hostname: home-assistant
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.19.12-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 238313472
  memTotal: 2066886656
  networkBackend: cni
  ociRuntime:
    name: crun
    package: crun-1.6-2.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.6
      commit: 18cf2efbb8feb2b2f20e316520e0fd0b6c41ef4d
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 19h 45m 17.00s (Approximately 0.79 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 13
    paused: 0
    running: 0
    stopped: 13
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 16631443456
  graphRootUsed: 3813478400
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.2.1
  Built: 1662580699
  BuiltTime: Wed Sep  7 19:58:19 2022
  GitCommit: ""
  GoVersion: go1.18.5
  Os: linux
  OsArch: linux/amd64
  Version: 4.2.1
@giuseppe
Copy link
Member

have you added additional IDs to /etc/subuid and /etc/subgid for the containers user?

@ingobecker
Copy link
Author

I'm running Fedora CoreOS as the host system which comes with the entry containers:165536:65536 in /etc/sub*id by default. One thing i recognized though is that the system doesn't come with a user containers by default. I created one by myself because i'm not sure if the entries in /etc/sub*id make sense without a corresponding user.

@giuseppe giuseppe transferred this issue from containers/podman Oct 25, 2022
@giuseppe giuseppe self-assigned this Oct 25, 2022
@giuseppe
Copy link
Member

PR here: #1411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants