containers / containers/podman-compose

unmounting network namespace for container failed to remove ns path device or resource busy

Open
#1,321 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Sometimes `podman compose down --volumes` fails with the error: unmounting network namespace for container failed to remove ns path device or resource busy.

**To Reproduce**

Steps to reproduce the behavior:

1. clone https://github.com/rgl/ubuntu-podman-compose-example
2. `podman compose up --build -d`
3. `podman compose down --volumes`

**Expected behavior**

I expected to see no errors.

**Actual behavior**

```console
$ podman compose down --volumes
2025-10-11 15:53:13.803 time="2025-10-11T15:53:13+01:00" level=error msg="Unable to clean up network for container 98796ebd2a9ac7032845c3ded3768a933a72b72c2d0fb7f4179368bc1e66f546: \"unmounting network namespace for container 98796ebd2a9ac7032845c3ded3768a933a72b72c2d0fb7f4179368bc1e66f546: failed to remove ns path /run/user/112/netns/netns-c5b0e388-2628-cc82-7bff-893543533369: remove /run/user/112/netns/netns-c5b0e388-2628-cc82-7bff-893543533369: device or resource busy\""
2025-10-11 15:53:13.803 jenkins-ubuntu-podman-compose-example-2_etcd_1
2025-10-11 15:53:14.062 jenkins-ubuntu-podman-compose-example-2_hello_1
2025-10-11 15:53:14.062 jenkins-ubuntu-podman-compose-example-2_hello_1
2025-10-11 15:53:14.321 jenkins-ubuntu-podman-compose-example-2_etcd_1
2025-10-11 15:53:14.321 jenkins-ubuntu-podman-compose-example-2_etcd-data
2025-10-11 15:53:14.321 3d42ce140b6cc93ab60a2ed95c9079f72ca6bfd074d6fce97ae5d849b2ad0229
2025-10-11 15:53:14.591 jenkins-ubuntu-podman-compose-example-2_default
```

**Output**

```console
$ podman-compose version
podman-compose version 1.5.0
podman version 4.9.3
```

**Environment:**

- OS: Ubuntu Linux 24.04
- podman version: 4.9.3
- podman compose version: 1.5.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the linked ubuntu-podman-compose-example repository with `podman compose up --build -d` followed by `podman compose down --volumes`. Start by tracing the network cleanup path for the reported `/run/user/112/netns/` namespace path and compare behavior on the stated Podman and Ubuntu versions. Done means teardown completes without the device-or-resource-busy error and removes the related containers, network namespace, and volumes.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.