containers / podman-desktop

Podman Desktop - A graphical tool for developing on containers and Kubernetes
https://podman-desktop.io
Apache License 2.0
4.33k stars 276 forks source link

Podman machine cannot be stopped from PD after starting a container #6975

Open cbr7 opened 2 months ago

cbr7 commented 2 months ago

Bug description

It seems that on macOS(wasn't able to reproduce on windows 11) it's not possible to stop a podman machine after starting a container, however after the fail error is throw all the images/containers/pods will become unavailable, presumably because the podman machine entering some error state.

https://github.com/containers/podman-desktop/assets/106525396/5feeba0d-375a-49fd-8bc5-fe5782158e70

Operating system

macOS

Installation Method

Installer from website/GitHub releases

Version

1.10.0

Steps to reproduce

  1. Start a podman machine on macOS with applehv.
  2. Pull and image.
  3. Run the image as a container.
  4. After the container starts running go into Settings and try to stop the podman machine.
  5. Notice the failure error thrown.
  6. Navigate to images/containers/pods menus and notice that all the items are gone.

Relevant log output

Error: failed waiting for vm to stop

Error: failed waiting for vm to stopode 125

Starting machine "podman-machine-default"25

API forwarding listening on: /var/run/docker.sock
Docker API clients default to this address. You do not need to set DOCKER_HOST.

Machine "podman-machine-default" started successfully

Error: failed waiting for vm to stop

Starting machine "podman-machine-default"25

API forwarding listening on: /var/run/docker.sock
Docker API clients default to this address. You do not need to set DOCKER_HOST.

Machine "podman-machine-default" started successfully

Error: failed waiting for vm to stop

Command execution failed with exit code 125

===============================================

CLI output:

vladimirlazar@Vladimirs-MacBook-Pro-2 ~ % podman machine list
NAME                     VM TYPE     CREATED         LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default*  applehv     27 minutes ago  Currently running  6           12.11GiB    93GiB
podman-machine-rootless  applehv     23 minutes ago  21 minutes ago     4           3.725GiB    93GiB
vladimirlazar@Vladimirs-MacBook-Pro-2 ~ % podman images
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: ssh: handshake failed: read tcp 127.0.0.1:56739->127.0.0.1:53782: read: connection reset by peer
vladimirlazar@Vladimirs-MacBook-Pro-2 ~ % podman machine stop
Machine "podman-machine-default" stopped successfully
vladimirlazar@Vladimirs-MacBook-Pro-2 ~ %

Additional context

No response

benoitf commented 2 months ago

should it be more reported on podman side ? Podman Desktop is not involved if basically it's just 'podman start', 'run a container' and call 'podman machine stop'

odockal commented 2 months ago

Reproduced on Mac OS 14 M2.

odockal commented 2 months ago

But it eventually stopped. Even with an error, but stopped.

cbr7 commented 2 months ago

Created issue https://github.com/containers/podman/issues/22515 in podman repo.

odockal commented 2 months ago

@cbr7 thanks!

benoitf commented 2 months ago

I've checked with podman 4.9.4 and it's still 1mn

There is area for improvement but it looks it's not a 'new issue' (for the severity)

If you try with containers without interactive shell it should be immediate

xbabalov commented 2 months ago

While trying to reproduce this issue and I was able to stop the machine with no problems, but it wouldn't start again, ending the process with "Command execution failed with exit code 125" as well.

odockal commented 1 week ago

@cbr7 We have patch merged in upstream, we could test it out, although, I am not sure where it should land exactly (client, engine inside vm?)