colima: Colima unable to restart on m1 after operating system restart

Description

We are seeing an issue where colima will not restart after OS X shuts down if colima is running during shutdown.

➜  ~ colima start --verbose
INFO[0000] using docker runtime
INFO[0000] starting colima
INFO[0000] starting ...                                  context=vm
> msg="Using the existing instance \"colima\""
> msg="errors inspecting instance: [failed to get Info from \"/Users/dipdhanesha/.lima/colima/ha.sock\": Get \"http://lima-hostagent/v1/info\": dial unix /Users/dipdhanesha/.lima/colima/ha.sock: connect: connection refused]"
FATA[0000] error starting vm: error at 'starting': exit status 1

Version

Colima Version:

➜  ~ colima version
colima version 0.3.4
git commit: 5a4a70481ca8d1e794677f22524e3c1b79a9b4ae

Lima Version:

➜  ~ limactl --version
limactl version 0.10.0

Qemu Version:

➜  ~ qemu-img --version
qemu-img version 6.2.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

Operating System

  • macOS Intel
  • macOS M1
  • Linux

Reproduction Steps

  1. colima start
  2. Shutdown Mac OS (without running colima stop)
  3. Start Mac OS
  4. colima start

Expected behaviour

Colima starts successfully

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 14
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Hey, @abiosoft , and @dip-thistle I had the same issue. I tried stopping broken instance and started it again it worked.

limactl stop -f colima

INFO[0000] The QEMU process seems already stopped       
INFO[0000] Sending SIGKILL to the host agent process 1689 
ERRO[0000] operation not permitted                      
INFO[0000] Removing *.pid *.sock under "/Users/sravanth/.lima/colima" 
INFO[0000] Removing "/Users/sravanth/.lima/colima/ga.sock" 
INFO[0000] Removing "/Users/sravanth/.lima/colima/ha.pid" 
INFO[0000] Removing "/Users/sravanth/.lima/colima/ha.sock"

colima start

INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] preparing network ...                         context=vm
INFO[0001] starting ...                                  context=vm
INFO[0023] provisioning ...                              context=docker
INFO[0023] starting ...                                  context=docker
INFO[0029] done  

limactl stop -f colima

This is equivalent to colima stop -f

As a developer using a m1 Mac, I experience this issue on a daily basis while working with nodejs and php containers. I hope a solution can be found without the need for frequent restarts.

a colima restart -f also fixed it for me

What is the output of colima list?

Does deleting the socket file has any effect? i.e. delete and try again.

rm /Users/dipdhanesha/.lima/colima/ha.sock
colima start

I had the same issue on 2019 Intel Macbook Pro after a OS restart.

The error was:

> errors inspecting instance: [failed to get Info from "/Users/JEROME/.lima/colima/ha.sock": Get "http://lima-hostagent/v1/info": dial unix /Users/JEROME/.lima/colima/ha.sock: connect: connection refused]

After executing colima stop -f everything was ok

limactl stop -f colimaworked for me.

Thank you. deleting ha.sock, ha.pid and vz.pid got me back up and running

Hi @abiosoft, This is the output of colima list

➜  ~ colima list
PROFILE    STATUS    ARCH       CPUS    MEMORY    DISK
default    Broken    aarch64    6       8GiB      60GiB

I removed the socket file and tried running the command again but it did not work. This was the output.

➜  ~ rm /Users/dipdhanesha/.lima/colima/ha.sock
➜  ~ colima start
INFO[0000] using docker runtime
INFO[0000] starting colima
INFO[0000] starting ...                                  context=vm
> msg="Using the existing instance \"colima\""
> msg="errors inspecting instance: [failed to connect to \"/Users/dipdhanesha/.lima/colima/ha.sock\": stat /Users/dipdhanesha/.lima/colima/ha.sock: no such file or directory]"
FATA[0000] error starting vm: error at 'starting': exit status 1

Try to delete ha.pid