Snapcraft can't re-use build VM if anything went wrong with the initial setup

Bug #1794497 reported by Kyle Fazzari
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Low
Sergio Schvezov

Bug Description

I made the mistake of trying build VMs from source, which installs snapcraft from the stable channel in the VM, which doesn't support managed-host as a build environment. This error looks like this:

$ SNAPCRAFT_BUILD_ENVIRONMENT=multipass snapcraft
Launching a VM.
Launched: snapcraft-my-snap-name
2018-09-26T09:54:29Z INFO Waiting for restart...
core 16-2.35 from 'canonical' installed
snapcraft 2.43.1 from Canonical✓ installed
SNAPCRAFT_BUILD_ENVIRONMENT must be one of: 'host' or 'lxd'.
An error occurred when trying to execute 'snapcraft refresh' with 'multipass': returned exit code 2.

Okay, so I installed a snap on my host that I knew would work, and ran again:

$ SNAPCRAFT_BUILD_ENVIRONMENT=multipass snapcraft
Launching a VM.
failed to launch: instance "snapcraft-my-snap-name" already exists
An error occurred when trying to launch the instance with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

I need to either run `SNAPCRAFT_BUILD_ENVIRONMENT=multipass snapcraft clean` or blow away the instance manually using multipass in order to continue. Snapcraft should handle this situation better.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Low
Changed in snapcraft:
status: Triaged → In Progress
Changed in snapcraft:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.