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

Colima stop fails #589

Closed
1 of 5 tasks
williamokano-dh opened this issue Jan 18, 2023 · 10 comments · Fixed by #591
Closed
1 of 5 tasks

Colima stop fails #589

williamokano-dh opened this issue Jan 18, 2023 · 10 comments · Fixed by #591
Labels
bug Something isn't working

Comments

@williamokano-dh
Copy link

williamokano-dh commented Jan 18, 2023

Description

I started the colima using colima start as per documentation and noticed that it doesn't forward the SSH by default. I tried stopping colima for start using colima start --ssh-agent but I cannot stop colima. Tried colima stop and even colima stop -f and always get the below error.

$ colima stop
INFO[0000] stopping colima
INFO[0000] stopping ...                                  context=vm
FATA[0010] error stopping vm: error at 'stopping': error running [/usr/local/bin/colima daemon stop default], output: "pkill: illegal option -- F", err: "exit status 1"

Version

Colima Version: 0.5.2
git commit: 6b5b6fe
runtime: docker
arch: x86_64
Lima Version: 0.14.2

Qemu Version: 7.2.0

Operating System

  • macOS Intel <= 12 (Monterrey)
  • macOS Intel >= 13 (Ventura)
  • macOS M1 <= 12 (Monterrey)
  • macOS M1 >= 13 (Ventura)
  • Linux

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/[User]/.colima/default/docker.sock

Reproduction Steps

  1. colima start
  2. colima stop

Expected behaviour

Colima should stop running gracefully

Additional context

No response

@abiosoft
Copy link
Owner

Did you recently upgrade?
Also, can you share the output of which pkill.

Nonetheless, this should be handled. No error is supposed to prevent a stop.

@williamokano-dh
Copy link
Author

williamokano-dh commented Jan 18, 2023

Not upgraded, but I installed colima yesterday using brew (brew install colima docker)

$ which pkill
/usr/local/bin/pkill

@abiosoft
Copy link
Owner

It seems your pkill is not the default one for macOS.

@abiosoft abiosoft added the bug Something isn't working label Jan 19, 2023
@williamokano-dh
Copy link
Author

williamokano-dh commented Jan 19, 2023

@abiosoft interesting. I never updated this piece of software myself, as I don't even knew it existed.

I checked for symlinks and seems like it was installed by some package from brew, but I don't know how to investigate which one installed it.

ls -lhsa $(which pkill)
0 lrwxr-xr-x  1 [User]  [Group]    37B Aug 26  2021 /usr/local/bin/pkill -> ../Cellar/proctools/0.4pre1/bin/pkill

Running brew deps --tree --installed seems like that the proctools is not a dependency but was rather installed on my machine, maybe by the laptop administrators.

The version of this pkill is

$ pkill -V
pkill (proctools 0.4pre1) http://proctools.sourceforge.net

Sorry for causing any disturbance. Removing the proctools from my mac seems to have fixed the issue. I'll try to understand why do I have this particular version on my machine.

If you think it's a fluke, feel free to close the ticket.

@rhess-rms
Copy link

rhess-rms commented Jan 20, 2023

I'm having this same issue today, and I have the computer-standard pkill

INFO[0001] stopping ...                                  context=vm
> [hostagent] Stopping forwarding "/run/lima-guestagent.sock" (guest) to "<user>/.lima/colima/ga.sock" (host)
> [hostagent] Unmounting "/Users/rhess"
> [hostagent] Unmounting "/tmp/colima"
> [hostagent] Shutting down QEMU with ACPI
> [hostagent] Sending QMP system_powerdown command
> did not receive an event with the "exiting" status
FATA[0182] error stopping vm: error at 'stopping': exit status 1 
$ which pkill
/usr/bin/pkill

@abiosoft
Copy link
Owner

abiosoft commented Jan 20, 2023

@williamokano-dh it's not a fluke, your scenario shouldn't prevent Colima from stopping. It will be fixed.

@rhess-rms your issue looks different. You can try stopping with --verbose or --very-verbose flag to get more debug output.

@abiosoft
Copy link
Owner

@williamokano-dh this should be fixed now. You can try the development version with brew install --HEAD colima.

@Vandaahl
Copy link

Vandaahl commented Mar 6, 2023

I'm having an issue with stopping Colima as well. I'm on 0.5.3.

$ colima status
INFO[0000] colima is running using macOS Virtualization.Framework 
INFO[0000] arch: aarch64                                
INFO[0000] runtime: docker                              
INFO[0000] mountType: virtiofs                          
INFO[0000] socket: unix:///Users/me/.colima/default/docker.sock 
$ colima stop
INFO[0002] stopping ...                                  context=vm
> Sending SIGINT to hostagent process 4616
> Waiting for the host agent and the driver processes to shut down
> [hostagent] 2023/03/06 08:56:41 tcpproxy: for incoming conn 127.0.0.1:50872, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: no route to host
> [hostagent] Received SIGINT, shutting down the host agent
> [hostagent] Shutting down the host agent
> [hostagent] Stopping forwarding "/var/run/docker.sock" (guest) to "/Users/me/.colima/default/docker.sock" (host)
> [hostagent] Stopping forwarding "/var/run/docker.sock" (guest) to "/Users/me/.colima/docker.sock" (host)
> [hostagent] Stopping forwarding "/run/lima-guestagent.sock" (guest) to "/Users/me/.lima/colima/ga.sock" (host)
> [hostagent] Shutting down VZ
> [hostagent] dhcp: unhandled message type: RELEASE
> [hostagent] panic: runtime/cgo: misuse of an invalid Handle
> [hostagent] goroutine 17 [running, locked to thread]:
> [hostagent] runtime/cgo.Handle.Value(...)
> [hostagent] 	/opt/homebrew/Cellar/go/1.20.1/libexec/src/runtime/cgo/handle.go:124
> [hostagent] github.com/Code-Hex/vz/v3.changeStateOnObserver(0x0, 0x14000002680?)
> [hostagent] 	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/!code-!hex/vz/v3@v3.0.4/virtualization.go:160 +0xe8
> did not receive an event with the "exiting" status
FATA[0182] error stopping vm: error at 'stopping': exit status 1 

Afterwards:

$ colima status
FATA[0000] colima is not running  

@abiosoft
Copy link
Owner

abiosoft commented Mar 9, 2023

@Vandaahl your issue different and it's specific to the VZ driver. It is being tracked upstream at lima-vm/lima#1381.

@mlorenzatiglb
Copy link

do pgrep of the qemu and kill it, colima will response then

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

Successfully merging a pull request may close this issue.

5 participants