Snapcraft command can't complete

Hello, I’m a newbie. When I build snapscaft.yaml from tutorials then:
$ snapcraft
Launching a VM.
launch failed: failed to download from ‘https://cloud-images.ubuntu.com/minimal/releases/bionic/release/ubuntu-18.04-minimal-cloudimg-amd64.img’: Network timeout
An error occurred with the instance when trying to launch with ‘multipass’: returned exit code 2.
Ensure that ‘multipass’ is setup correctly and try again.

Logs from multipass:
$ sudo snap logs -f multipass
2020-05-29T13:37:55Z dnsmasq[6317]: using local addresses only for domain multipass
2020-05-29T13:37:55Z dnsmasq[6317]: reading /etc/resolv.conf
2020-05-29T13:37:55Z dnsmasq[6317]: using local addresses only for domain multipass
2020-05-29T13:37:55Z dnsmasq[6317]: using nameserver 127.0.0.53#53
2020-05-29T13:37:55Z dnsmasq[6317]: read /etc/hosts - 7 addresses
2020-05-29T13:37:55Z dnsmasq[6317]: cannot read /var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts: No such file or directory
2020-05-29T13:37:55Z multipassd[6140]: gRPC listening on unix:/var/snap/multipass/common/multipass_socket, SSL:on
2020-05-29T13:37:55Z multipassd[6140]: QIODevice::write (QFile, “/var/snap/multipass/common/cache/multipassd/vault/multipassd-image-records.json”): device not open
2020-05-29T13:37:55Z multipassd[6140]: Starting Multipass 1.2.0
2020-05-29T13:37:55Z multipassd[6140]: Daemon arguments: /snap/multipass/2114/bin/multipassd --verbosity debug --logger platform

I don’t know what’s happening and how can I fix for this problem? please help me. Thanks

Hi @tady, it’s just what it says on the tin: we failed to download the image due to a timeout. Most likely your internet connection, or the host where images come from, is congested… Can you see it counting % and then failing, or does it never move from 0%?

1 Like

it counting to 14% and then failing.
I tried to create file dnsmasq.hosts and it counting to 100% but:

~/mysnaps/test$ snapcraft
Launching a VM.
launch failed: Downloaded image hash does not match
An error occurred with the instance when trying to launch with ‘multipass’: returned exit code 2.
Ensure that ‘multipass’ is setup correctly and try again.

You don’t need the .hosts file, it’s a warning, not an error.

What does a multipass launch snapcraft:core18 --name test say now?

You will need to multipass delete --purge test to get rid of it again.

All else fails, try clearing Multipass and installing it again:

snap remove --purge multipass
snap install multipass

It does sound like the network connection is somewhat unstable.

I reinstalled and it work well. thank you:v