Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbox create command (ran from within toolbx) is not failing when container already exists. #957

Open
JayDoubleu opened this issue Dec 15, 2021 · 6 comments · May be fixed by #1052
Open
Labels
1. Bug Something isn't working
Milestone

Comments

@JayDoubleu
Copy link

Describe the bug
toolbox create command is not failing when container already exists while running from within toolbox

Steps how to reproduce the behaviour

[user@hostname ~]$ toolbox create --distro fedora --release f35
Error: container fedora-toolbox-35 already exists
Enter with: toolbox enter
Run 'toolbox --help' for usage.
[user@hostname ~]$ echo $?
1

[user@hostname ~]$ toolbox run toolbox create --distro fedora --release f35
[user@hostname ~]$ echo $?
0
[user@hostname ~]$ 

Expected behaviour
Should return Error: container fedora-toolbox-35 already exists and return code 1

Actual behaviour
No output and return code 0

Output of toolbox --version (v0.0.90+)
toolbox version 0.0.99.2

Toolbox package info (rpm -q toolbox)
e.g., toolbox-0.0.18-2.fc32.noarch

Output of podman version

Version:      3.4.2
API Version:  3.4.2
Go Version:   go1.16.8
Built:        Fri Nov 12 20:25:37 2021
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)
podman-3.4.2-1.fc35.x86_64

Info about your OS
e.g., Fedora Silverblue 35

Other information

Same result when running from interactive shell inside toolbox as well as with toolbox run

@JayDoubleu JayDoubleu added the 1. Bug Something isn't working label Dec 15, 2021
@JayDoubleu
Copy link
Author

In fact, seems like toolbox create just returns 0 when ran in general

toolbox create --distro fedora --release f34
echo $?
0

@debarshiray
Copy link
Member

Good catch! It seems that while tunneling things back and forth over flatpak-spawn, the standard error output and the exit codes are getting lost.

@JayDoubleu
Copy link
Author

JayDoubleu commented Dec 16, 2021

There is still few bugs here and there with flatpak-spawn it seems (flatpak/flatpak#3697). I'm not sure if it was designed to perform things toolbx requires.

Out of curiosity, would it be a difficult and reasonable task for this logic to be embedded into a toolbx itself in case flatpak-spawn is trying to solve different problems and has its own roadmap?

There is already few solutions mentioned that might perform better than what's included in flatpak-spawn. I also know that tilix terminal emulator has one built into their app too (gnome-terminator/terminator#347 (comment))

@HarryMichal HarryMichal added this to the Release 0.1.0 milestone Dec 17, 2021
@debarshiray
Copy link
Member

@HarryMichal we might have to take this off the milestone for 0.1.0 if this ends up requiring some major surgery.

@debarshiray
Copy link
Member

Out of curiosity, would it be a difficult and reasonable task for this logic to
be embedded into a toolbx itself

Yes, possibly.

in case flatpak-spawn is trying to solve
different problems and has its own roadmap?

That's unlikely. It's the same group of people after all. We'll see. We have to figure out exactly what's going wrong here.

@JayDoubleu JayDoubleu changed the title toolbox create command is not failing when container already exists and while from within toolbox toolbox create command (ran from within toolbx) is not failing when container already exists. Dec 17, 2021
@JayDoubleu
Copy link
Author

flatpak-spawn --host --watch-bus --forward-fd=1 --forward-fd=2 --directory="$(pwd)" --env=TERM=xterm-256color toolbox create fedora-toolbox-35 <- this seems to work ok tho ( stolen from #863 (comment))

HarryMichal added a commit to HarryMichal/toolbox that referenced this issue May 13, 2022
HarryMichal added a commit to HarryMichal/toolbox that referenced this issue May 13, 2022
@HarryMichal HarryMichal linked a pull request May 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants