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

Distrobox enter hangs indefinitely upon restarting image #1382

Closed
pgosar opened this issue May 8, 2024 · 4 comments
Closed

Distrobox enter hangs indefinitely upon restarting image #1382

pgosar opened this issue May 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@pgosar
Copy link

pgosar commented May 8, 2024

Please, before opening a bug:

  • make sure you've read the documentation.
  • Ensure there isn't already an open issue about this.
  • Ensure there isn't already a closed/resolved issue about this.

Describe the bug
When using the command distrobox enter , it hangs. I have a decently powerful laptop and let it run for 30 minutes. Upon ending the process, I am met with this message. This happens everytime I restart the container.

/usr/bin/distrobox-enter: line 680: /home/<user>/.cache/distrobox/.ubuntu-20-04.fifo: No such file or directory

Distrobox is using docker behind the scenes.

To Reproduce
distrobox create -i ubuntu:20.04

distrobox enter ubuntu-20-04

Expected behavior
I'd expect it to not hang. Note that it does work fine if I end the process and enter the image again. Furthermore I believe there should be a fifo file being created under $home/.cache/distrobox? However no matter what I do such as stopping the running image, remaking it, etc. this file does not show up.

Logs
create.txt - first command
enter.txt - second command

Attach also the output of podman logs or docker logs, possibly with --latest flag
docker.txt - docker logs

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod? - docker
  • Which version or podman, docker or lilipod? - Docker version 26.1.1, build 4cf5afaefa
  • Which version of distrobox? - 1.7.2.0
  • Which host distribution? - Arch Linux, kernel 6.8.9
  • How did you install distrobox? - with pacman

Additional context
Add any other context about the problem here.

@pgosar pgosar added the bug Something isn't working label May 8, 2024
@pgosar pgosar changed the title Distrobox enter Distrobox enter hangs indefinitely upon restarting image May 8, 2024
@profetik-777
Copy link
Contributor

Have you tried with podman to see / pinpoint if this is only happening with docker?

@pgosar
Copy link
Author

pgosar commented May 8, 2024

Just docker - tested it with podman 5.0.2

@rmeno12
Copy link

rmeno12 commented May 8, 2024

Am also experiencing the same hanging. If I interrupt with Ctrl-C, I get the same fifo error. Running distrobox enter <container_name> again works without hanging or other error messages.
I am on Arch kernel 6.6.30 with distrobox 1.72.1 using docker.

@elgq
Copy link

elgq commented Jun 18, 2024

I got this issue too when I switched from podman to docker, and checking the source code of distrobox-enter I noticed the following:

  • In line 624 gets the current timestamp in UTC format
log_timestamp="$(date -u +%FT%T)"
  • Then is passed to docker in line 652, to fill a fifo file that is read later for a message.
${container_manager} logs --since "${log_timestamp}" -f "${container_name}" \
			> "${app_cache_dir}/.${container_name}.fifo" 2>&1 &
  • the --since parameter as the docker documentation says it expects a timestamp that supposedly is in UTC as the docker logs -t <container> shows.
  • but it doesnt show any log line, and the message that is expected to break a loop in lines 674 - 677 doesnt occur.
"container_setup_done"*)
	printf >&2 "\033[32m [ OK ]\n\033[0m"
	kill "${logs_pid}" > /dev/null 2>&1
	break 2	
  • If the timestamp is changed to localtime in line 624, distrobox-enter works correctly.
log_timestamp="$(date +%FT%T)"

So or it is a bug with docker --since parameter or the docker/containers need some kind of timezone configuration to match the parameter.

EDIT: I was close enough, the --since parameter for docker needs a Z at the end .

date -u +%FT%TZ

Test :

$docker logs -ft fedora
...
2024-06-18T23:06:20.151478801Z ++ curl -s --unix-socket /run/docker.sock http://docker/containers/fedora/json
2024-06-18T23:06:20.151504502Z ++ grep -Eo '"Id":"[a-zA-Z0-9]{64}",'
2024-06-18T23:06:20.151559731Z ++ cut -d '"' -f4
2024-06-18T23:06:20.155200164Z + id=1d02e9db87eebc7d4c6dc0233857aa0279e9e0ecb33e85edf4014d955b96d817
2024-06-18T23:06:20.155209842Z + set +x

$ date -u +%FT%T # as in line 624
2024-06-18T23:07:45

$ docker logs -t --since 2024-06-18T23:06:20 fedora
# nothing

$ date -u +%FT%TZ
2024-06-18T23:10:17Z

$ docker logs -t --since 2024-06-18T23:06:20Z fedora
# returns lines
...
2024-06-18T23:06:20.151559731Z ++ cut -d '"' -f4
2024-06-18T23:06:20.155200164Z + id=1d02e9db87eebc7d4c6dc0233857aa0279e9e0ecb33e85edf4014d955b96d817
2024-06-18T23:06:20.155209842Z + set +x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants