Running snapcraft always fails the first time

Hi all

Running snapcraft (using multipass) always fails the first time, subsequent runs always work. Just a minor inconvience.

snapcraft

Launching a VM.
Build environment was created with unknown snapcraft version None, cleaning.
delete failed: The following errors occurred:
instance "snapcraft-pi" does not exist
An error occurred with the instance when trying to delete with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

Immediately after:

snapcraft

Launching a VM.
Launched: snapcraft-pi                                                          
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]                
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]        
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]          
Get:4 http://archive.ubuntu.com/ubuntu bionic/universe Sources [9051 kB]             
Get:5 http://archive.ubuntu.com/ubuntu bionic/main Sources [829 kB]                           
Get:6 http://archive.ubuntu.com/ubuntu bionic/multiverse Sources [181 kB]       
Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted Sources [5324 B]       
Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1019 kB]     
Get:9 http://archive.ubuntu.com/ubuntu bionic/main Translation-en [516 kB]

Versions

snap version
snap    2.45.1
snapd   2.45.1
series  16
ubuntu  18.04
kernel  4.15.0-108-generic

snapcraft version
snapcraft, version 4.0.7

multipass --version
multipass  1.3.0
multipassd 1.3.0
1 Like

Is this with Ubuntu 18.04 Server on the Pi? If so are you using armhf or arm64 ?

If you run snapcraft clean; snapcraft does it reproduce?

This is done in a Ubuntu 18.04 Desktop in a VM I’m running, weirdly enough, I experience the same error in another Ubuntu 19.04 Desktop VM.

lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic

Running following, it indeed gives the error message, but then continues;

snapcraft clean; snapcraft

delete failed: The following errors occurred:
instance "snapcraft-beacon" does not exist
An error occurred with the instance when trying to delete with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
Launching a VM.
Starting snapcraft-beacon \

if you run snapcraft clean in a source tree that has never been built before, where would a multipass instance come from ?

multipass creates build instances only if you build a snap, calling snapcraft clean in a virgin source tree i would actually expect that no instance in multipass exists yet so this message seems pretty correct to me … your subsequent snapcraft call then obviously succeeds as it should …

The error always occurs, regardless, it was suggested by @cjp256.

Is multipass strict or classic?

Output of snap list multipass will mention classic in the Notes column.

It is running under strict

snap list multipass

Name       Version  Rev   Tracking       Publisher   Notes
multipass  1.3.0    2259  latest/stable  canonical✓  -

I also am hitting this error message a lot…

sometimes only reinstalling multipass fixes it for a while.