containers / containers/podman-compose

AttributeError: 'Namespace' object has no attribute 'remove_orphans'

Open
#732 6 comments 10 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**

It looks like `compose_down` refers to `args.remove_orphans` which is not defined if `compose_run` is called. I'm using the latest podman-compose on Fedora.

**To Reproduce**
Steps to reproduce the behavior:
1. A simple compose file:

```yaml
services:
dep:
image: alpine
command: false

abc:
image: alpine
command: echo hi
depends_on: ['dep']
```

3. `podman-compose run abc`

**Expected behavior**
Not to crash.

**Actual behavior**
When I use `podman-compose run` I get a stack trace.

**Output**

```
Traceback (most recent call last):
File "/usr/bin/podman-compose", line 33, in
sys.exit(load_entry_point('podman-compose==1.0.6', 'console_scripts', 'podman-compose')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2940, in main
podman_compose.run()
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1422, in run
cmd(self, args)
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1753, in wrapped
return func(*args, **kw)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2254, in compose_run
compose.commands["up"](compose, up_args)
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1753, in wrapped
return func(*args, **kw)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2055, in compose_up
compose.commands["down"](compose, down_args)
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1753, in wrapped
return func(*args, **kw)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2168, in compose_down
if args.remove_orphans:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'remove_orphans'
```

**Environment:**
- OS: Fedora 38
- podman version: 4.5.1
- podman compose version: 1.0.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.