#1119718 buildah is unable to umount or delete working container if storage is not empty

Package:
buildah
Source:
buildah
Description:
CLI tool to facilitate building OCI images
Submitter:
Alexandre SKRZYNIARZ
Date:
2025-11-11 14:31:02 UTC
Severity:
normal
Tags:
#1119718#5
Date:
2025-10-31 09:02:41 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

I tried to build a container image from scratch with buildah.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

I used the default configuration of podman / buildah.

The procedure I use is as follow:

container=$(buildah from scratch)
mountpoint=$(buildah unshare buildah mount $container)
buildah unshare mmdebstrap --variant=minbase --include=tmux,vim trixie $mountpoint trixie.sources.list

# the next part will fails:
buildah unshare buildah umount $container

buildah config --cmd /bin/bash $container
buildah commit -f oci $container debian:13

# the next part will fails
buildah rm $container

   * What was the outcome of this action?

It seems there is an issue with overlay graph driver.

It can be trivially reproduced as follow

container=$(buildah from scratch)
mountpoint=$(buildah unshare buildah mount $container)
cd $mountpoint
touch HELLO
cd -
buildah unshare buildah umount $container

You get this error.

Error: error unmounting container "working-container": unmounting build container "72bf36c33f1c8fbecc28e5c481e2a4798aff143fdef01394cfc2ecfdb22d75f5": replacing mount point "/home/skrzynia/.local/share/containers/storage/overlay/d6f81b6236edec4ee0e26c702c8b4f5f21bb660b06d7e753974d7a6a7fed9e03/merged": directory not empty

You have a similar message when trying to remove the container

buildah rm $container

Error: removing container "working-container": deleting build container "72bf36c33f1c8fbecc28e5c481e2a4798aff143fdef01394cfc2ecfdb22d75f5": replacing mount point "/home/skrzynia/.local/share/containers/storage/overlay/d6f81b6236edec4ee0e26c702c8b4f5f21bb660b06d7e753974d7a6a7fed9e03/merged": directory not empty

If removing HELLO file, the container can be unmounted or deleted without issues.



   * What outcome did you expect instead?

I should have been able to unmount or delete the working container

   * Other informations

- I reproduced the issue with a fresh forky virtual machine too (buildah 1.41.5)
- I don't have the issue with the VFS storage driver, it seems related to overlay.
- as overlay is the default configuration, this bug should be annoying for every user.

This is the output of buildah info:

{
    "host": {
        "CgroupVersion": "v2",
        "Distribution": {
            "distribution": "debian",
            "version": "13"
        },
        "MemFree": 18551738368,
        "MemTotal": 33570467840,
        "OCIRuntime": "runc",
        "SwapFree": 40467689472,
        "SwapTotal": 40467689472,
        "arch": "amd64",
        "cpus": 32,
        "hostname": "octopus",
        "kernel": "6.12.35+deb13-amd64",
        "os": "linux",
        "rootless": true,
        "uptime": "96h 47m 36.04s (Approximately 4.00 days)",
        "variant": ""
    },
    "store": {
        "ContainerStore": {
            "number": 1
        },
        "GraphDriverName": "overlay",
        "GraphOptions": null,
        "GraphRoot": "/home/skrzynia/.local/share/containers/storage",
        "GraphStatus": {
            "Backing Filesystem": "extfs",
            "Native Overlay Diff": "true",
            "Supports d_type": "true",
            "Supports shifting": "false",
            "Supports volatile": "true",
            "Using metacopy": "false"
        },
        "ImageStore": {
            "number": 0
        },
        "RunRoot": "/run/user/1000/containers"
    }
}

#1119718#10
Date:
2025-11-03 01:15:35 UTC
From:
To:
Hi Alexandre,

Thanks for the detailed bug report -- it seems clear and easy to reproduce,
which helps a lot.

The issue also appears in Buildah 1.41.5 upstream and is tied to the overlay
driver in rootless mode, so it would be good to report it to the Buildah team.

Could you please file it at:
https://github.com/containers/buildah/issues

You can reuse your Debian report as-is. Just include the buildah info output
and the minimal touch HELLO example, and note that it works with vfs but not
overlay.  Once it’s filed, could you reply here with the upstream issue number?
I'll keep watching that bug and engage with upstream as necssary.


best,
-rt

#1119718#19
Date:
2025-11-03 01:15:35 UTC
From:
To:
Hi Alexandre,

Thanks for the detailed bug report -- it seems clear and easy to reproduce,
which helps a lot.

The issue also appears in Buildah 1.41.5 upstream and is tied to the overlay
driver in rootless mode, so it would be good to report it to the Buildah team.

Could you please file it at:
https://github.com/containers/buildah/issues

You can reuse your Debian report as-is. Just include the buildah info output
and the minimal touch HELLO example, and note that it works with vfs but not
overlay.  Once it’s filed, could you reply here with the upstream issue number?
I'll keep watching that bug and engage with upstream as necssary.


best,
-rt

#1119718#24
Date:
2025-11-06 09:11:47 UTC
From:
To:
Hi Reinhard,

The upstream bug number is 6480.

Best regards