Snapcraft stopped working issuing multipass error

Snapcraft does not work since yesterday (2022 May 22) evening although in the morning it worked fantastically! When I ran snapcraft in a project directory, for example, in the hello tutorial folder, it displays the following error:

Launching a VM.
Build environment is in unknown state, cleaning first.
info failed: The following errors occurred:
instance "snapcraft-hello" does not exist
launch failed: Remote "snapcraft" is unknown or unreachable.                    
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.

Here is the output of the command sudo snap logs multipass:

2022-05-23T20:18:34+03:00 multipassd[13898]: Cannot retrieve headers for https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img: Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found
2022-05-23T20:18:34+03:00 multipassd[13898]: Could not update manifest: failed to download from 'https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img': Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found

The command curl https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img returned

404 Not Found

Not Found

The requested URL was not found on this server.


Apache/2.4.29 (Ubuntu) Server at cloud-images.ubuntu.com Port 443

I searched manually in the folder https://cloud-images.ubuntu.com/kinetic/current/ but found no image with that name.

What is wrong?

3 Likes

Now, I think I found a fix. The problem seems to be that the file kinetic-server-cloudimg-amd64-disk.img is not present on the server. Here is how to fix it. Assume you are making the project hello, and you are in its root directory (which is hello, and which contains the sub-directory snap with the file snapcraft.yaml.)

Step 1: Clean the project. You can omit this step if you are 100% sure it is clean. Launch a multipass Virtual Machine (VM):

multipass launch -n snapcraft-hello -m 2G -d 12G https://cloud-images.ubuntu.com/kinetic/current/kinetic-server-cloudimg-amd64.img

The switch -m 2G means, the VM will use 2G RAM, and -d 12G 12G disk space. You need this much space if, for example, you run flutter. If you build a project with another name, say myprj adjust the VM name to snapcraft-myprj. Check that the VM is correctly created and running with the command:

multipass list

It should output something like this:

Name                    State             IPv4             Image
snapcraft-hello         Running           11.239.64.56     Not Available

Now clean the project:

snapcraft clean

This is also cleaning the VM; thus, in the next step, you have to re-run it.

Step 2: Build the snap. Again, launch a multipass Virtual Machine (VM):

multipass launch -n snapcraft-hello -m 2G -d 12G https://cloud-images.ubuntu.com/kinetic/current/kinetic-server-cloudimg-amd64.img

and check that it is correctly created and running. Now build your project:

snapcraft

Step 3: Clean the project. You don’t have to create another VM, because the VM from Step 2 is still there. Just run

snapcraft clean

This will also clean away the VM. Check this with

multipass list

which should output something like this:

No instances found.

Enjoy your build!

3 Likes

Hi this happens to me,

Did you know why is happen, yesterday I was able to build snaps, but a multipass updated came and no the snapcraft command no longer works, I think this is a bug or something,

This is the snapcraft erro:

edu@edu-T14s:~/git/onedriver$ snapcraft 
Launching a VM.
Build environment is in unknown state, cleaning first.
info failed: The following errors occurred:
instance "snapcraft-onedriver" does not exist
launch failed: Remote "snapcraft" is unknown or unreachable.                    
An error occurred with the

this workaround didn’t help me this are my multipass logs:

2022-05-23T21:53:48-06:00 multipassd[922]: VM powering down
2022-05-23T21:53:49-06:00 multipassd[922]: QMP: {"timestamp": {"seconds": 1653364429,  "microseconds": 654691}, "event": "SHUTDOWN", "data": {"guest": true, "reason": "guest-shutdown"}}
2022-05-23T21:53:49-06:00 multipassd[922]: VM shut down
2022-05-23T21:53:49-06:00 multipassd[922]: process state changed to NotRunning
2022-05-23T21:53:49-06:00 multipassd[922]: process finished with exit code 0
2022-05-23T21:53:49-06:00 dnsmasq-dhcp[1945]: DHCPRELEASE(mpqemubr0) 10.230.2.52 52:54:00:4d:13:9a
2022-05-23T21:53:54-06:00 multipassd[922]: Cannot retrieve headers for https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img: Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found
2022-05-23T21:53:54-06:00 multipassd[922]: Could not update manifest: failed to download from 'https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img': Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found
2022-05-23T21:54:18-06:00 multipassd[922]: Cannot retrieve headers for https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img: Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found
2022-05-23T21:54:18-06:00 multipassd[922]: Could not update manifest: failed to download from 'https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img': Error transferring https://cloud-images.ubuntu.com/buildd/daily/kinetic/current/kinetic-server-cloudimg-amd64-disk.img - server replied: Not Found

I’m trying to build using core20

This happened because Snapcraft tried to clean up your project, and as a result of this it cleaned away the VM too. Retry starting from Step 1.

Hi @faliagas!

Thanks for the help, I try 3 times yesterday and each time snapcraft does not detect the state of the instance and starts cleaning it and then error occurs, does not try to build the snap.

I would try again later to day, thanks for your help :slight_smile:

but it seems weird that some people start reporting this same problems at the same time, snapcraft was working before the multipass update.

Edit. Find the bug report see:

https://github.com/canonical/multipass/issues/2587

It seems that for some reason Multipass is trying to build another img rather than core20. This is why the error mention kinetic (development version) and it’s not finding core20

Edit 2. Find launchpad bug report see:

Hey All!

I’m the manager for Multipass and first wanted to say sorry for the troubles this has caused. :slightly_frowning_face: The fix is in queue and we’re waiting for continuous integration to complete before I prep a new Multipass snap package release. The CI should finish real soon and then I can get the snap packages to start building.

4 Likes

Hi @townsend

We know this things happen, thanks for the quick response and for all the work :slight_smile:!!

Ok, version 1.9.2 of the Multipass snap is now available in stable. Thanks for your patience!

5 Likes

I am facing this issue on multipass version 1.12.0-rc.368+g2b92bf17.

Remote "snapcraft" is unknown or unreachable

snap logs multipass show

Cannot fetch image information: Unable to find an image matching hash 31c…

Hi @devtoolmaker!

Looks like you are using the brand new shiny Multipass 1.12 release candidate. Could you please enter a bug report at https://github.com/canonical/multipass/issues/new?assignees=&labels=bug&template=bug_report.md&title= and provide the full logs, etc?

Thanks!

I tried multiple other versions after that and logs are removed now. Which multipass version do you recommend to install? Earlier I had installed via --classic --beta which gave above error and after that tried without any of those params (so stable version), and got “the client is not authenticated with multipass”

Hi @devtoolmaker!

I’m sorry, it’s very difficult to tell what is going on without being able to parse the logs when this error condition happens. I recommend using the --stable channel.

Regarding the “client not authenticated”, please make sure the Multipass tray icon client is closed and do a snap remove --purge multipass to ensure all the files are removed and also remove everything under ~/snap/multipass.

2 Likes

that did the trick purging old multipass and installing from stable channel. thank you

Hi @townsend. I faced the same issue with multipass 1.11.0 and snapcraft 7.3.1. Unfortunately, reinstalling didn’t work for me. However, I was able to solve my problem with this solution.