podman: unable to run rootless container: error with setrlimit RLIMIT_NPROC
/kind bug
Description
I’m unable to run a rootless container, podman returns the following error:
$ podman run --rm golang:1.14-alpine go version
Error: setrlimit `RLIMIT_NPROC`: Invalid argument: OCI runtime error
I’m on Fedora 32. I’m sure running a rootless container worked with Fedora 31 but I’m not sure if the problem appeared as soon as I migrated to Fedora 32 or if it appeared later since I don’t use podman that often.
Steps to reproduce the issue:
podman run --rm golang:1.14-alpine go version(or any image really)
Describe the results you received:
Error: setrlimit `RLIMIT_NPROC`: Invalid argument: OCI runtime error
Describe the results you expected:
I expect the container to run correctly.
Additional information you deem important (e.g. issue happens only occasionally):
I tried:
- uninstalling podman, libpod, conmon, container-selinux, containers-common
- removing the directories
$HOME/.local/share/containersand$HOME/.config.containers - reinstalling podman
but the error remains.
Output of podman version:
Version: 1.9.2
RemoteAPI Version: 1
Go Version: go1.14.2
OS/Arch: linux/amd64
Output of podman info --debug:
debug:
compiler: gc
gitCommit: ""
goVersion: go1.14.2
podmanVersion: 1.9.2
host:
arch: amd64
buildahVersion: 1.14.8
cgroupVersion: v2
conmon:
package: conmon-2.0.16-2.fc32.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.16, commit: 1044176f7dd177c100779d1c63931d6022e419bd'
cpus: 8
distribution:
distribution: fedora
version: "32"
eventLogger: file
hostname: thor
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.14-300.fc32.x86_64+debug
memFree: 3684970496
memTotal: 16685846528
ociRuntime:
name: crun
package: crun-0.13-2.fc32.x86_64
path: /usr/bin/crun
version: |-
crun version 0.13
commit: e79e4de4ac16da0ce48777afb72c6241de870525
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
os: linux
rootless: true
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.0.0-1.fc32.x86_64
version: |-
slirp4netns version 1.0.0
commit: a3be729152a33e692cd28b52f664defbf2e7810a
libslirp: 4.2.0
swapFree: 2147479552
swapTotal: 2147479552
uptime: 1h 11m 1.23s (Approximately 0.04 days)
registries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- registry.centos.org
- docker.io
store:
configFile: /home/vincent/.config/containers/storage.conf
containerStore:
number: 4
paused: 0
running: 0
stopped: 4
graphDriverName: overlay
graphOptions:
overlay.mount_program:
Executable: /usr/bin/fuse-overlayfs
Package: fuse-overlayfs-1.0.0-1.fc32.x86_64
Version: |-
fusermount3 version: 3.9.1
fuse-overlayfs: version 1.0.0
FUSE library version 3.9.1
using FUSE kernel interface version 7.31
graphRoot: /home/vincent/.local/share/containers/storage
graphStatus:
Backing Filesystem: btrfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "false"
imageStore:
number: 8
runRoot: /run/user/1000/containers
volumePath: /home/vincent/.local/share/containers/storage/volumes
Package info (e.g. output of rpm -q podman or apt list podman):
podman-1.9.2-1.fc32.x86_64
It’s a desktop PC.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 68 (32 by maintainers)
I just faced the same issue after updating kernel from 6.2.x to 6.3.1. Recreating the containers worked.
Using fedora kinoite, i’ve noticed changes in max user processes (
ulimit -u -H) sometimes increase sometimes a decrease, when it decreases below the value it was when i created the container it basically causes this issue but i do not know why it keeps on changingSorry what does it mean? Can I recreate the containers keeping all theirs data?
FWIW, I managed to backup my containers in F32, then rebase on F33 and restore the backups using this tutorial: https://fedoramagazine.org/backup-and-restore-toolboxes-with-podman/
You don’t have to re-create the containers: https://unix.stackexchange.com/questions/127777/how-to-configure-the-process-open-file-limit-of-a-user
I just encountered this issue today on Fedora Silverblue after an update. Here’s the weird bit:
It’s off-by-one (127724 vs 127723). A bit obnoxious, considering that I have to go recreate my toolboxes 😦
I don’t use docker/podman that heavily, my normal workflow is to just start what I need in my project with
If your case is similar, a quick workaround for this issue could be this:
# podman inspect --format '{{ printf "%+v" .HostConfig.Ulimits }}' fedora-toolbox-32 [{Name:RLIMIT_NOFILE Soft:524288 Hard:524288} {Name:RLIMIT_NPROC Soft:62509 Hard:62509}]So I added the following line to limits.conf (my user is in the group wheel - but you could use another one or the user):
@wheel hard nproc 62509I have a similar situation. A container that was working a few days/weeks ago no longer works:
I checked the container’s limit:
These were just one above the current (default) hard limit on the system:
I have no custom ulimits set on the system. I added the following to
/etc/security/limits.d/11-podman.conffor now to fix this:Not sure what changed or when. System is Arch Linux with Linux 5.17.2-arch2-1. After logging in again to set the new limits I was able to launch the container.
I got same error message when I try to restart the running pod. It started happening just today, was working totally fine few days before. No changes in limits.conf
just ran into the same issue create a new file
/etc/security/limits.d/100-podman.confwith the following contentwhere value is the max value gather from RLIMIT_NPROC using
podman inspect my-distrobox --format '{{ .HostConfig.Ulimits }}'then logout and log back in and just rebootprofit! no need to recreate the containers
I got my existing toolbox container working by setting the nproc limit for my user in /etc/security/limits.conf to the value reported for the existing container with podman inspect --format ‘{{ printf “%+v” .HostConfig.Ulimits }}’
Ok with some of my older containers, I am seeing these fields being set.
But newer containers I am creating with podman 2.0. Does not create the Ulimits.
FWIW I started getting this error on Arch Linux also once Linux 5.7 hit the core repositories a few days ago. I’d previously been running rootless containers on this system just fine for months.
I am also using cgroups v1:
Edit: Oops, I just downgraded my kernel to 5.6.15 on Arch and I still can’t run any containers. Something else must have broken it. For reference:
I’ve definitely run containers in the past week, so it must have broken sometime around then.