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 start fails most of the time: error validating SHA sum #1163

Open
1 of 5 tasks
pedroarthur opened this issue Oct 11, 2024 · 24 comments
Open
1 of 5 tasks

colima start fails most of the time: error validating SHA sum #1163

pedroarthur opened this issue Oct 11, 2024 · 24 comments

Comments

@pedroarthur
Copy link

Description

I had to run colima start more than 5 times for it to start correctly. I am running from AWS-hosted M1 and M2 machines. Output follows:

colima --verbose start -p default --cpu 8 --memory 12 --disk 256 --vm-type=vz --vz-rosetta
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] creating and starting ...                     context=vm
INFO[0000] downloading disk image ...                    context=vm
FATA[0006] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': exit status 1

Version

colima version 0.7.5
git commit: 1588c066b9ab9dae8205ef265929c7eb43dca473

runtime: docker
arch: aarch64
client: v27.3.1
server: v27.1.1
limactl version 0.23.2
qemu-img version 9.1.0
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

(I don't know if it matters, but I run this after a successful download)

colima status
INFO[0001] colima is running using macOS Virtualization.Framework 
INFO[0001] arch: aarch64                                
INFO[0001] runtime: docker                              
INFO[0001] mountType: virtiofs                          
INFO[0001] socket: unix:///Users/ec2-user/.colima/default/docker.sock

Reproduction Steps

  1. colima --verbose start -p default --cpu 8 --memory 12 --disk 256 --vm-type=vz --vz-rosetta

Expected behaviour

No response

Additional context

No response

@dayfuaim
Copy link

Confirm this.
I have this same problem too.

colima 0.7.5
Apple Silicon >= 14 (Sonoma)

@KevinHuang40856
Copy link

same problem too. colima 0.7.5, apple m1, Sequoia 15.0.1.

as saw the 0.7.1 in download link " https://github.com/abiosoft/colima-core/releases/download/v0.7.1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2", use asdf to install v0.7.0. ( tried to install 0.7.4, saw the same v0.7.1 in download link)

asdf plugin add lima
asdf plugin add colima
asdf install colima 0.7.0
asdf local colima  0.7.0 or asdf global colima 0.7.0

@abiosoft
Copy link
Owner

saw the 0.7.1 in download link

The disk image versioning is not directly tied to Colima versions, that is not an issue.

@KevinHuang40856
Copy link

yes, you are right. what i mean is i saw disk image versioning changed from version 0.7.1 so i gave a try version 0.7.0 and it works. once installed, i can upgrade to 0.7.5, still works, it looks like not download the new version qcow2 image. however, cleaned up the cache, install 0.7.5 freshly, can re-produce the issue.

i checked the checksum, both version images checksum in the github assets are correct, also manually downloaded images, still correct checksum. the code change to curl is just added flag "I". struggle to find which code change in version 0.7.1 caused the issue .

@KevinHuang40856
Copy link

KevinHuang40856 commented Oct 30, 2024

hit the same error for the latest version 0.7.6, output with --very-verbose as below

❯ colima start --very-verbose
TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] error retrieving running instance: instance 'colima' does not exist
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["/Users/xxx/.asdf/shims/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["/Users/xxx/.asdf/shims/colima" "daemon" "stop" "default"]
TRAC[0003] cmd ["/Users/xxx/.asdf/shims/colima" "daemon" "start" "default" "--inotify" "--inotify-runtime" "docker" "--inotify-dir" "/Users/xxx/" "--inotify-dir" "/tmp/colima/" "--very-verbose"]
TRAC[0003] cmd ["/Users/xxx/.asdf/shims/colima" "daemon" "status" "default"]
INFO[0004] creating and starting ...                     context=vm
INFO[0004] downloading disk image ...                    context=vm
TRAC[0004] cmd ["mkdir" "-p" "/Users/xxx/Library/Caches/colima/caches"]
TRAC[0004] cmd ["curl" "-ILs" "-o" "/dev/null" "-w" "%{url_effective}" "https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2"]
TRAC[0005] cmd int ["curl" "-L" "-#" "-C" "-" "-o" "/Users/xxx/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "https://objects.githubusercontent.com/github-production-release-asset-2e65be/716288883/692eefa3-b31c-406f-b22d-7511a80b121b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241030%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241030T215535Z&X-Amz-Expires=300&X-Amz-Signature=9be4f35fc243492fa657962f599fd966a25a996f90efa8e3e34082e969afec1a&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2&response-content-type=application%2Foctet-stream"]
TRAC[0006] cmd ["sh" "-c" "cd /Users/xxx/Library/Caches/colima/caches/ && echo \"3a4e66446d953b5ab612c4ef8c2d7ca9d07c180216c436a4afe15cdcd94e0736de48e4779ce85f9190f22fa918719259710971dbb215c73d15addb6bf23b280c  c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading\" | shasum -a 512 --check --status"]
TRAC[0006] cmd ["mv" "/Users/xxx/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "/Users/xxx/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid"]
FATA[0005] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': exit status 1

the file /Users/xxx/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid is 0 size

❯ ls -alh c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid
-rw-r--r--  1 staff  staff     0B 31 Oct 10:55 c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid

Installed colima 0.7.0 and run colima start --very-verbose, output as below

colima start --very-verbose
TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] error retrieving running instance: instance 'colima' does not exist
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["/Users/xxx/.asdf/installs/colima/0.7.0/bin/colima" "daemon" "status" "default"]
TRAC[0000] cmd ["/Users/xxx/.asdf/installs/colima/0.7.0/bin/colima" "daemon" "stop" "default"]
TRAC[0001] cmd ["/Users/xxx/.asdf/installs/colima/0.7.0/bin/colima" "daemon" "start" "default" "--inotify" "--inotify-runtime" "docker" "--inotify-dir" "/Users/xxx/" "--inotify-dir" "/tmp/colima/" "--very-verbose"]
TRAC[0001] cmd ["/Users/xxx/.asdf/installs/colima/0.7.0/bin/colima" "daemon" "status" "default"]
INFO[0001] creating and starting ...                     context=vm
INFO[0001] downloading disk image ...                    context=vm
TRAC[0001] cmd ["mkdir" "-p" "/Users/xxx/Library/Caches/colima/caches"]
TRAC[0001] cmd ["curl" "-Ls" "-o" "/dev/null" "-w" "%{url_effective}" "https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2"]
TRAC[0090] cmd int ["curl" "-L" "-#" "-C" "-" "-o" "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.downloading" "https://objects.githubusercontent.com/github-production-release-asset-2e65be/716288883/43841e31-7d6a-4dd1-a604-1d19596bff57?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241030%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241030T215602Z&X-Amz-Expires=300&X-Amz-Signature=8e156aa69cff583b862647fe1b04b2415287fb55a0f699f6567e71976f6c643f&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2&response-content-type=application%2Foctet-stream"]
TRAC[0184] cmd ["sh" "-c" "cd /Users/xxx/Library/Caches/colima/caches/ && echo \"4c6f3b90067629ebe9bad3c156d6f849ccfb54585ec1af0ee72a9f58c20b9794504a6742e74c9259056db951f9f6d9168a303ea819219278a54f4df4c66a3cf6  4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.downloading\" | shasum -a 512 --check --status"]
TRAC[0185] cmd ["mv" "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.downloading" "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b"]
TRAC[0185] cmd ["qemu-img" "convert" "-f" "qcow2" "-O" "raw" "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b" "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.raw"]
TRAC[0187] cmd ["limactl" "start" "--tty=false" "/var/folders/qm/6wfq69xj7k5c04gdm4d__z780000gq/T/colima.yaml"]
> Terminal is not available, proceeding without opening an editor
> Starting the instance "colima" with VM driver "qemu"
> QEMU binary "/opt/homebrew/bin/qemu-system-aarch64" seems properly signed with the "com.apple.security.hypervisor" entitlement
> "Attempting to download the image" arch=aarch64 digest= location=/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.raw
> Downloaded the image from "/Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.raw"
> [hostagent] hostagent socket created at /Users/xxx/.colima/_lima/colima/ha.sock
> [hostagent] Using system firmware ("/opt/homebrew/share/qemu/edk2-aarch64-code.fd")
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/xxx/.colima/_lima/colima/serial*.log")
> SSH Local Port: 50258
> [hostagent] Waiting for the essential requirement 1 of 4: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 4: "ssh"
> [hostagent] The essential requirement 1 of 4 is satisfied
> [hostagent] Waiting for the essential requirement 2 of 4: "user session is ready for ssh"
> [hostagent] The essential requirement 2 of 4 is satisfied
> [hostagent] Waiting for the essential requirement 3 of 4: "sshfs binary to be installed"
> [hostagent] The essential requirement 3 of 4 is satisfied
> [hostagent] Waiting for the essential requirement 4 of 4: "fuse to \"allow_other\" as user"
> [hostagent] The essential requirement 4 of 4 is satisfied
> [hostagent] Mounting "/Users/xxx" on "/Users/xxx"
> [hostagent] Mounting "/tmp/colima" on "/tmp/colima"
> [hostagent] Waiting for the guest agent to be running
> [hostagent] Forwarding "/var/run/docker.sock" (guest) to "/Users/xxx/.colima/default/docker.sock" (host)
> [hostagent] Forwarding "/var/run/docker.sock" (guest) to "/Users/xxx/.colima/docker.sock" (host)
> [hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/xxx/.colima/_lima/colima/ga.sock" (host)
> [hostagent] Guest agent is running
> [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished"
> [hostagent] Not forwarding TCP 127.0.0.54:53
> [hostagent] Not forwarding TCP 127.0.0.53:53
> [hostagent] Not forwarding TCP [::]:22
> [hostagent] The final requirement 1 of 1 is satisfied
> READY. Run `limactl shell colima` to open the shell.
TRAC[0200] cmd ["mkdir" "-p" "/Users/xxx/Library/Caches/colima/docker-certs"]
TRAC[0200] cmd ["cp" "-R" "/Users/xxx/.docker/certs.d/." "/Users/xxx/Library/Caches/colima/docker-certs"]
TRAC[0200] cmd ["lima" "sudo" "mkdir" "-p" "/etc/docker/certs.d"]
TRAC[0200] cmd ["lima" "sudo" "cp" "-R" "/Users/xxx/Library/Caches/colima/docker-certs/." "/etc/docker/certs.d"]
TRAC[0200] cmd ["lima" "sudo" "mkdir" "-p" "/etc/ssl/certs"]
TRAC[0200] cmd ["lima" "sudo" "cp" "-R" "/Users/xxx/Library/Caches/colima/docker-certs/." "/etc/ssl/certs"]
TRAC[0200] cmd ["lima" "command" "-v" "binfmt"]
TRAC[0201] cmd ["lima" "sh" "-c" "sudo QEMU_PRESERVE_ARGV0=1 /usr/bin/binfmt --install amd64"]
> installing: amd64 OK
> {
>   "supported": [
>     "linux/arm64",
>     "linux/amd64"
>   ],
>   "emulators": [
>     "python3.12",
>     "qemu-x86_64"
>   ]
> }
INFO[0201] provisioning ...                              context=docker
TRAC[0201] cmd ["lima" "sudo" "mkdir" "-p" "/etc/docker"]
TRAC[0201] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/docker/daemon.json"]
TRAC[0201] cmd ["lima" "sh" "-c" "grep 'host.lima.internal' /etc/hosts | awk -F' ' '{print $1}'"]
TRAC[0201] cmd ["lima" "sudo" "mkdir" "-p" "/etc/systemd/system/docker.service.d"]
TRAC[0201] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/systemd/system/docker.service.d/docker.conf"]
TRAC[0201] cmd ["docker" "context" "inspect" "colima"]
TRAC[0201] cmd ["docker" "context" "use" "colima"]
> colima
> Current context is now "colima"
INFO[0201] starting ...                                  context=docker
TRAC[0201] cmd ["lima" "sudo" "service" "docker" "start"]
TRAC[0201] cmd ["lima" "sudo" "docker" "info"]
TRAC[0201] cmd ["lima" "docker" "info"]
TRAC[0202] cmd ["lima" "sudo" "cat" "/etc/colima/colima.json"]
TRAC[0202] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
TRAC[0202] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
TRAC[0202] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/colima/colima.json"]
TRAC[0202] cmd ["lima" "sudo" "cat" "/etc/colima/colima.json"]
TRAC[0202] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
TRAC[0202] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
TRAC[0202] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/colima/colima.json"]
INFO[0202] done
TRAC[0202] cmd ["limactl" "list" "--json"]

the file /Users/xxx/Library/Caches/colima/caches/4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b looks good

 ❯ ls -alh 4e1d6f9076c36aa5dc942101c9*
-rw-r--r--  1 xxx  staff   324M 31 Oct 10:59 4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b
-rw-r--r--  1 xxx  staff   3.5G 31 Oct 10:59 4e1d6f9076c36aa5dc942101c931e0230f3c2c4eafae3c050ebc072dda0ad76b.raw

@abiosoft
Copy link
Owner

@KevinHuang40856 can you share the output of the command which shasum?

And does it fail all the time or intermittently?

@KevinHuang40856
Copy link

KevinHuang40856 commented Oct 31, 2024

@abiosoft sure, the outpuf of command which shasum as below
❯ which shasum /usr/bin/shasum

with my testing, any fresh installation of versions higher than v0.7.0 will fail all the time.

@abiosoft
Copy link
Owner

@KevinHuang40856
Copy link

@abiosoft sure. it matches.

`❯ curl -L -o ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2 https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 373M 100 373M 0 0 3986k 0 0:01:36 0:01:36 --:--:-- 4237k`

❯ shasum -a 512 ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2 1e128da890e9d8b07a3c2556fe200ce3c724108d099eacce311b520507f6e2d114430991d1b68ecf9ad66a915eb315f433a950bdff09450224c34d9529b88890 ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2

@pedroarthur
Copy link
Author

The problem keeps happening in v0.8.0 with

@KevinHuang40856
Copy link

yes, tested v0.8.0, same error. and tested v0.7.6, v0.7.1, got new errors "panic: runtime error: invalid memory address or nil pointer dereference", until finally got colima start run successfully after switched back to v0.7.0. full output
`❯ colima start
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x10455ab28]

goroutine 1 [running]:
github.com/abiosoft/colima/cmd.prepareConfig(0x0?)
/Users/runner/work/colima/colima/cmd/start.go:455 +0xa88
github.com/abiosoft/colima/cmd.glob..func16(0x1048162e0?, {0x1048611e0?, 0x0?, 0x104563910?})
/Users/runner/work/colima/colima/cmd/start.go:96 +0x70
github.com/spf13/cobra.(*Command).execute(0x1048162e0, {0x1048611e0, 0x0, 0x0})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:970 +0x7e8
github.com/spf13/cobra.(*Command).ExecuteC(0x104817700)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/abiosoft/colima/cmd/root.Execute()
/Users/runner/work/colima/colima/cmd/root/root.go:68 +0x24
main.main()
/Users/runner/work/colima/colima/cmd/colima/main.go:12 +0x1c
❯ rm -rf .colima
❯ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0001] creating and starting ... context=vm
INFO[0001] downloading disk image ... context=vm
FATA[0004] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': exit status 1
❯ asdf global colima 0.7.0
❯ colima version
colima version v0.7.0
git commit: 4b14e8a
❯ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0015] provisioning ... context=docker
INFO[0015] starting ... context=docker
INFO[0033] done`

@KevinHuang40856
Copy link

once got colima v0.7.0 started successfully, install newer version including v0.8.0 and have no problem to run colima start

`❯ asdf install colima 0.8.0

  • Downloading colima release 0.8.0...
    colima 0.8.0 installation was successful!
    ❯ colima stop
    INFO[0000] stopping colima
    INFO[0000] stopping ... context=docker
    INFO[0000] stopping ... context=vm
    INFO[0002] done
    ❯ asdf global colima 0.8.0
    ❯ colima start
    INFO[0000] starting colima
    INFO[0000] runtime: docker
    INFO[0000] starting ... context=vm
    INFO[0013] provisioning ... context=docker
    INFO[0014] starting ... context=docker
    INFO[0016] done
    ❯ colima version
    colima version v0.8.0
    git commit: 9c08cff

runtime: docker
carch: aarch64
client: v27.3.1
server: v27.1.1
❯ colima status
INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/si565819/.colima/default/docker.sock`

@KevinHuang40856
Copy link

❯ rm -rf .colima ❯ colima start --runtime containerd INFO[0000] starting colima INFO[0000] runtime: containerd INFO[0001] creating and starting ... context=vm INFO[0001] downloading disk image ... context=vm FATA[0004] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2': exit status 1 ❯ colima version colima version v0.8.0 git commit: 9c08cff339f087c0600d9d56af7b5fbcfe02e287

@KevinHuang40856
Copy link

run " colima start --runtime containerd" which will download different image for colima v0.8.0, same error validating SHA sum error

❯ colima start --runtime containerd INFO[0000] starting colima INFO[0000] runtime: containerd INFO[0001] creating and starting ... context=vm INFO[0001] downloading disk image ... context=vm FATA[0004] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2': exit status 1 ❯ colima version colima version v0.8.0 git commit: 9c08cff339f087c0600d9d56af7b5fbcfe02e287

@samupl
Copy link

samupl commented Dec 6, 2024

I just hit this issue again and I don't think it's related to the version of colima itself.

When I try to start colima I get:

...
INFO[0001] downloading disk image ...                    context=vm
TRAC[0001] cmd ["mkdir" "-p" "/Users/js/Library/Caches/colima/caches"]
TRAC[0001] cmd ["curl" "-ILs" "-o" "/dev/null" "-w" "%{url_effective}" "https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2"]
TRAC[0002] cmd int ["curl" "-L" "-#" "-C" "-" "-o" "/Users/js/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2"]
TRAC[0002] cmd ["sh" "-c" "cd /Users/js/Library/Caches/colima/caches/ && echo \"3a4e66446d953b5ab612c4ef8c2d7ca9d07c180216c436a4afe15cdcd94e0736de48e4779ce85f9190f22fa918719259710971dbb215c73d15addb6bf23b280c  c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading\" | shasum -a 512 --check --status"]
TRAC[0002] cmd ["mv" "/Users/js/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "/Users/js/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid"]
FATA[0002] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': exit status 1

What I imediatelly noticed is that according to my internet connection at the moment, downloading this 300MB file should take noticeably longer. So I checked what it actually downloaded:

❯ cd /Users/js/Library/Caches/colima/caches/
❯ file c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid
c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid: HTML document text, ASCII text, with CRLF line terminators
❯ head -n 10 c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid

<!DOCTYPE html>
<html>
  <head>
    <meta content="origin" name="referrer">
    <title>Forbidden &middot; GitHub</title>
    <style type="text/css" media="screen">
      body {
        background-color: #f1f1f1;
        margin: 0;

I was able to download the file by just opening it via the browser, but I could not download it using curl - this suggests that the CDN used by github is blocking curl user agent.

However after a few tries - eventually it allowed me to download the file using curl which suggests that it's just some mirrors that fail. That's also when colima start started working again.

I have not tested it, but it seems that by inspecting where colima start --very-verbose wants to save the file using curl, then downloading it & placing it there by hand it might be possible to resume starting the colima VM without issues - this is a possible, albeit very tricky workaround.

@mstoffel-sag
Copy link

mstoffel-sag commented Dec 10, 2024

Hi, any way to run colima? This is a real issue here. Cannot get my system running again after a reinstall of my mac. Is there a way to download the image and place it in the right spot?

@rsriniva
Copy link

does not work for me in 0.8. same error as seen by Kevin. direct download via curl passes. here is my very verbose output:

TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] error retrieving running instance: instance 'colima' does not exist
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "stop" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "default" "--inotify" "--inotify-runtime" "docker" "--inotify-dir" "/Users/rsriniva/" "--inotify-dir" "/tmp/colima/" "--very-verbose"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
INFO[0002] creating and starting ...                     context=vm
TRAC[0002] cmd ["system_profiler" "-json" "SPHardwareDataType"]
INFO[0002] downloading disk image ...                    context=vm
TRAC[0002] cmd ["mkdir" "-p" "/Users/rsriniva/Library/Caches/colima/caches"]
TRAC[0002] cmd ["curl" "-ILs" "-o" "/dev/null" "-w" "%{url_effective}" "https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2"]
TRAC[0003] cmd int ["curl" "-L" "-#" "-C" "-" "-o" "/Users/rsriniva/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "https://objects.githubusercontent.com/github-production-release-asset-2e65be/716288883/692eefa3-b31c-406f-b22d-7511a80b121b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241210%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241210T111425Z&X-Amz-Expires=300&X-Amz-Signature=40f9c8dd5a77676ef3f2c94ce77516367ad8c7c479801e3365e9c16bcb0facd2&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2&response-content-type=application%2Foctet-stream"]
TRAC[0030] cmd ["sh" "-c" "cd /Users/rsriniva/Library/Caches/colima/caches/ && echo \"3a4e66446d953b5ab612c4ef8c2d7ca9d07c180216c436a4afe15cdcd94e0736de48e4779ce85f9190f22fa918719259710971dbb215c73d15addb6bf23b280c  c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading\" | shasum -a 512 --check --status"]
> sha256sum: 'standard input': no properly formatted checksum lines found
TRAC[0030] cmd ["mv" "/Users/rsriniva/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading" "/Users/rsriniva/Library/Caches/colima/caches/c3056771d27045a9b7b665f5ddbbac4e311078337847c505226bd184c8191d0c.downloading.invalid"]
FATA[0030] error starting vm: error at 'creating and starting': error getting qcow image: error during image download: error downloading 'https://github.com/abiosoft/colima-core/releases/download/v0.7.6-1/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': error validating SHA sum for 'ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2': exit status 1```

@rsriniva
Copy link

any ideas on how to work around. I copied the downloaded qcow2 file to /Library/Caches/colima/caches folder, but it did not work

@rsriniva
Copy link

Here's my workaround

$ brew uninstall colima
$ brew install lima

Then manually download from github releases colima v6.9.10. Anything >=0.70 runs into this SHA mismatch error.

Copy the downloaded 0.6.9 version to /usr/local/bin. Allow macOS security to execute this binary

then re-run colima start - works!

colima status                                                                                                                                                                                                  ✔
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/rsriniva/.colima/default/docker.sock
Client: Docker Engine - Community
 Version:    27.4.0
 Context:    colima
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 27.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-36-generic
 Operating System: Ubuntu 24.04 LTS
 OSType: linux
 Architecture: aarch64
 CPUs: 6
 Total Memory: 15.58GiB
 Name: colima
 ID: bea89346-729a-4ce9-9c66-78538f5301ee
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8

@abiosoft
Copy link
Owner

Must have something to do with how curl is handling the downloads.

@rsriniva
Copy link

Must have something to do with how curl is handling the downloads.

yup. looks like github mirrors block the curl request with pre-set headers - perhaps the installation itself could download the qcow2 file and copy to the cache folder? What is the correct way to populate the local cache? does the qcow2 file need to be named with a hash?

@mstoffel-sag
Copy link

Must have something to do with how curl is handling the downloads.

yup. looks like github mirrors block the curl request with pre-set headers - perhaps the installation itself could download the qcow2 file and copy to the cache folder? What is the correct way to populate the local cache? does the qcow2 file need to be named with a hash?

That would really help, please provide a short description how to set up manually (or point us to the script etc. that does the downloading). I really like this project, but right now I just cannot work ....

@abiosoft
Copy link
Owner

That would really help, please provide a short description how to set up manually (or point us to the script etc. that does the downloading). I really like this project, but right now I just cannot work ....

This can be introduced as a cli flag.

@abiosoft
Copy link
Owner

abiosoft commented Dec 16, 2024

Ability to specify a previously downloaded disk image is being added in #1216, and would be included in the imminient release available in the new release https://github.com/abiosoft/colima/releases/tag/v0.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@abiosoft @samupl @pedroarthur @dayfuaim @rsriniva @mstoffel-sag @KevinHuang40856 and others