Skip to content

Commit

Permalink
Merge pull request #23891 from eriksjolund/troubleshooting-userns-auto
Browse files Browse the repository at this point in the history
troubleshooting: add tip about --userns=auto and --userns=keep-id
  • Loading branch information
openshift-merge-bot[bot] authored Sep 9, 2024
2 parents 649730c + 005d9b5 commit c12c86e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -1435,3 +1435,37 @@ Using the default `overlay` storage driver, a `COPY`, `ADD`, or an I/O intensive
This could be caused by the child container using `fuse-overlayfs` for writing to `/var/lib/containers/storage`. Writes can be slow with `fuse-overlayfs`. The solution is to use the native `overlay` filesystem by using a local directory on the host system as a volume to `/var/lib/containers/storage` like so: `podman run --privileged --rm -it -v ./nested_storage:/var/lib/containers/storage parent:latest`. Ensure that the base image of `parent:latest` in this example has no contents in `/var/lib/containers/storage` in the image itself for this to work. Once using the native volume, the nested container should not fall back to `fuse-overlayfs` to write files and the nested build will complete much faster.

If you don't have access to the parent run process, such as in a CI environment, then the second option is to change the storage driver to `vfs` in the parent image by changing changing this line in your `storage.conf` file: `driver = "vfs"`. You may have to run `podman system reset` for this to take effect. You know it's changed when `podman info |grep graphDriverName` outputs `graphDriverName: vfs`. This method is slower performance than using the volume method above but is significantly faster than `fuse-overlayfs`

### 43) `podman run --userns=auto` fails with "Error: creating container storage: not enough unused IDs in user namespace"

Using `--userns=auto` when creating new containers does not work as long as any containers exist that were created with `--userns=keep-id` or `--userns=nomap`

#### Symptom

1. Run with `--userns=auto`
```
$ podman run --rm -d --userns=auto alpine sleep 3600
```
The command succeeds.
2. Run with `--userns=auto`
```
$ podman run --rm -d --userns=auto alpine sleep 3600
```
The command succeeds.
3. Run with `--userns=keep-id`
```
$ podman run --rm -d --userns=keep-id alpine sleep 3600
```
The command succeeds.
4. Run with `--userns=auto`
```
$ podman run --rm -d --userns=auto alpine sleep 3600
```
The command fails with the error message
```
Error: creating container storage: not enough unused IDs in user namespace
```

#### Solution

Any existing containers that were created using `--userns=keep-id` or `--userns=nomap` must first be deleted before any new container can be created with `--userns=auto`

1 comment on commit c12c86e

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.