Describe the bug
The rm and rmi commands exits with status 0 even after an error.
Steps how to reproduce the behaviour
- Run
toolbox list to 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 be 0.
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.
|
fmt.Fprintf(os.Stderr, "Error: %s\n", err) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: %s\n", err) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: %s\n", err) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: %s\n", err) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: failed to inspect container %s\n", container) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: %s is not a Toolbx container\n", container) |
|
continue |
|
fmt.Fprintf(os.Stderr, "Error: %s\n", err) |
|
continue |
Describe the bug
The
rmandrmicommands exits with status 0 even after an error.Steps how to reproduce the behaviour
toolbox listto check if the container we're trying to remove doesn't exist (eg.test).toolbox rm test.Error: failed to inspect container test.echo $?and it will be0.Expected behaviour
The
toolboxshould exit with non-zero status code.Actual behaviour
The
toolboxexits with a status code0.Output of
toolbox --version(v0.0.90+)toolbox version 0.3Toolbx package info (
rpm -q toolbox)toolbox-0.3-1.fc43.x86_64Output of
podman versionPodman package info (
rpm -q podman)podman-5.7.0-1.fc43.x86_64Info about your OS
Fedora Linux 43.20251129.0 (Silverblue) x86_64Additional context
On the following lines there are
fmt.Fprintf()calls, followed bycontinue, so the error is reported, but given action continues.This is quite surprising when
toolboxis used in scripts or chained commands such astoolbox rm X && toolbox create X.toolbox/src/cmd/rmi.go
Lines 78 to 79 in e9ec7f1
toolbox/src/cmd/rmi.go
Lines 94 to 95 in e9ec7f1
toolbox/src/cmd/rmi.go
Lines 99 to 100 in e9ec7f1
toolbox/src/cmd/rm.go
Lines 78 to 79 in e9ec7f1
toolbox/src/cmd/rm.go
Lines 95 to 96 in e9ec7f1
toolbox/src/cmd/rm.go
Lines 100 to 101 in e9ec7f1
toolbox/src/cmd/rm.go
Lines 105 to 106 in e9ec7f1