-
Notifications
You must be signed in to change notification settings - Fork 239
Description
Describe the bug
The rm and rmi commands exits with status 0 even after an error.
Steps how to reproduce the behaviour
- Run
toolbox listto check if the container we're trying to remove doesn't exist (eg.test). - Try to remove it:
toolbox rm test. - An error message appears:
Error: failed to inspect container test. - Check the exit code
echo $?and it will be0.
Expected behaviour
The toolbox should exit with non-zero status code.
Actual behaviour
The toolbox exits with a status code 0.
Output of toolbox --version (v0.0.90+)
toolbox version 0.3
Toolbx package info (rpm -q toolbox)
toolbox-0.3-1.fc43.x86_64
Output of podman version
Client: Podman Engine
Version: 5.7.0
API Version: 5.7.0
Go Version: go1.25.4 X:nodwarf5
Git Commit: 0370128fc8dcae93533334324ef838db8f8da8cb
Built: Tue Nov 11 01:00:00 2025
Build Origin: Fedora Project
OS/Arch: linux/amd64
Podman package info (rpm -q podman)
podman-5.7.0-1.fc43.x86_64
Info about your OS
Fedora Linux 43.20251129.0 (Silverblue) x86_64
Additional context
On the following lines there are fmt.Fprintf() calls, followed by continue, so the error is reported, but given action continues.
This is quite surprising when toolbox is used in scripts or chained commands such as toolbox rm X && toolbox create X.
Lines 78 to 79 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s\n", err) | |
| continue |
Lines 94 to 95 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s\n", err) | |
| continue |
Lines 99 to 100 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s\n", err) | |
| continue |
Lines 78 to 79 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s\n", err) | |
| continue |
Lines 95 to 96 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: failed to inspect container %s\n", container) | |
| continue |
Lines 100 to 101 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s is not a Toolbx container\n", container) | |
| continue |
Lines 105 to 106 in e9ec7f1
| fmt.Fprintf(os.Stderr, "Error: %s\n", err) | |
| continue |