podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Podman machine cannot be stopped from PD after starting a container

Open cbr7 opened this issue 10 months ago • 8 comments

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

cbr7 avatar Apr 26 '24 09:04 cbr7

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'

benoitf avatar Apr 26 '24 09:04 benoitf

Reproduced on Mac OS 14 M2.

odockal avatar Apr 26 '24 10:04 odockal

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

odockal avatar Apr 26 '24 10:04 odockal

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

cbr7 avatar Apr 26 '24 10:04 cbr7

@cbr7 thanks!

odockal avatar Apr 26 '24 10:04 odockal

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

benoitf avatar Apr 26 '24 11:04 benoitf

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.

xbabalov avatar May 03 '24 09:05 xbabalov

@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?)

odockal avatar Jun 26 '24 07:06 odockal

Confirmed fixed in PD 1.12.

cbr7 avatar Aug 08 '24 08:08 cbr7

@cbr7 thanks for confirmation!

odockal avatar Aug 14 '24 05:08 odockal