abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.1k stars 383 forks source link

startup fail- Control socket connect #1165

Open bodsch opened 1 day ago

bodsch commented 1 day ago

Description

Fresh install of colima for local testing.

$ colima start
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] creating and starting ...                     context=vm
> "[hostagent] failed to exit SSH master" error="failed to execute `ssh -O exit -p 39849 127.0.0.1`, out=\"Control socket connect(/home/bodsch/.config/colima/_lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255"
> [hostagent] Shutting down QEMU with ACPI
> [hostagent] Failed to remove SSH binding for port 39849
> "[hostagent] failed to open the QMP socket \"/home/bodsch/.config/colima/_lima/colima/qmp.sock\", forcibly killing QEMU" error="dial unix /home/bodsch/.config/colima/_lima/colima/qmp.sock: connect: connection refused"
> [hostagent] QEMU has already exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/home/bodsch/.config/colima/_lima/colima/ha.stderr.log")
FATA[0000] error starting vm: error at 'creating and starting': exit status 1

Version

Operating System

Output of colima status

colima status
FATA[0000] colima is not running

Reproduction Steps

  1. install both packes direct from github and extract to /usr/local
  2. colima start
  3. fail

Expected behaviour

No response

Additional context

ha.stdout.log

{"time":"2024-10-16T14:14:31.682147467+02:00","status":{"sshLocalPort":39849}}
{"time":"2024-10-16T14:14:31.853121283+02:00","status":{"exiting":true}}

ha.stderr.log

{"level":"debug","msg":"Creating iso file /home/bodsch/.config/colima/_lima/colima/cidata.iso","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"Using /tmp/diskfs_iso1085749784 as workspace","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"OpenSSH version 9.9.1 detected","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"hostagent socket created at /home/bodsch/.config/colima/_lima/colima/ha.sock","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"QEMU version 9.1.0 detected","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"firmware candidates = [/home/bodsch/.local/share/qemu/edk2-x86_64-code.fd /usr/share/qemu/edk2-x86_64-code.fd /usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE_4M.fd /usr/share/edk2/ovmf/OVMF_CODE.fd /usr/share/qemu/ovmf-x86_64-code.bin /usr/share/edk2-ovmf/x64/OVMF_CODE.fd]","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Using system firmware (\"/usr/share/edk2-ovmf/x64/OVMF_CODE.fd\")","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/home/bodsch/.config/colima/_lima/colima/serial*.log\")","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"qCmd.Args: [/usr/bin/qemu-system-x86_64 -m 2048 -cpu host -machine q35,accel=kvm -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd -boot order=c,splash-time=0,menu=on -drive file=/home/bodsch/.config/colima/_lima/colima/diffdisk,if=virtio,discard=on -drive id=cdrom0,if=none,format=raw,readonly=on,file=/home/bodsch/.config/colima/_lima/colima/cidata.iso -device virtio-scsi-pci,id=scsi0 -device scsi-cd,bus=scsi0.0,drive=cdrom0 -netdev socket,id=net0,fd=3 -device virtio-net-pci,netdev=net0,mac=52:55:55:a6:3f:36 -device virtio-rng-pci -display none -device virtio-vga -device virtio-keyboard-pci -device virtio-mouse-pci -device qemu-xhci,id=usb-bus -parallel none -chardev socket,id=char-serial,path=/home/bodsch/.config/colima/_lima/colima/serial.sock,server=on,wait=off,logfile=/home/bodsch/.config/colima/_lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-serial-virtio,path=/home/bodsch/.config/colima/_lima/colima/serialv.sock,server=on,wait=off,logfile=/home/bodsch/.config/colima/_lima/colima/serialv.log -device virtio-serial-pci,id=virtio-serial0,max_ports=1 -device virtconsole,chardev=char-serial-virtio,id=console0 -chardev socket,id=char-qmp,path=/home/bodsch/.config/colima/_lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -chardev socket,path=/home/bodsch/.config/colima/_lima/colima/ga.sock,server=on,wait=off,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=io.lima-vm.guest_agent.0 -name lima-colima -pidfile /home/bodsch/.config/colima/_lima/colima/qemu.pid]","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 4: \"ssh\"","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/home/bodsch/.config/colima/_lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=bodsch -o ControlMaster=auto -o ControlPath=\"/home/bodsch/.config/colima/_lima/colima/ssh.sock\" -o ControlPersist=yes -p 39849 127.0.0.1 -- /bin/bash]","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 39849: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 39849: Connection refused\\r\\n\": exit status 255","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: -device virtio-vga: 'virtio-vga' is not a valid device model name","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Driver stopped due to error: \"exit status 1\"","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Shutting down the host agent","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"shutting down the SSH master","time":"2024-10-16T14:14:31+02:00"}
{"level":"debug","msg":"executing ssh for exiting the master: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/home/bodsch/.config/colima/_lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=bodsch -o ControlMaster=auto -o ControlPath=\"/home/bodsch/.config/colima/_lima/colima/ssh.sock\" -o ControlPersist=yes -O exit -p 39849 127.0.0.1]","time":"2024-10-16T14:14:31+02:00"}
{"error":"failed to execute `ssh -O exit -p 39849 127.0.0.1`, out=\"Control socket connect(/home/bodsch/.config/colima/_lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255","level":"warning","msg":"failed to exit SSH master","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"Shutting down QEMU with ACPI","time":"2024-10-16T14:14:31+02:00"}
{"level":"warning","msg":"Failed to remove SSH binding for port 39849","time":"2024-10-16T14:14:31+02:00"}
{"error":"dial unix /home/bodsch/.config/colima/_lima/colima/qmp.sock: connect: connection refused","level":"warning","msg":"failed to open the QMP socket \"/home/bodsch/.config/colima/_lima/colima/qmp.sock\", forcibly killing QEMU","time":"2024-10-16T14:14:31+02:00"}
{"level":"info","msg":"QEMU has already exited","time":"2024-10-16T14:14:31+02:00"}
michielsarne2 commented 1 day ago

Same on mac here

jeremiah commented 6 hours ago

This is a known bug. The solution that worked for me when I encountered the same problem on my M1 is listed here: https://github.com/abiosoft/colima/issues/381 towards the end.

TLDR;

  1. Remove the folder ~/.colima/_lima/_networks
  2. Restart colima