← Back to issue list

snapcraft fails to launch multipass instance when multipass isn't pre-installed

View original Github issue

Metadata

Project
snapcraft
Number
#5145
Type
issue
State
open
Author
sed-i
Labels
Created
Updated
Closed

Current evaluation

Snapcraft fails to launch a multipass VM with 'Remote snapcraft is unknown or unreachable' when multipass is installed on-demand. Maintainer triaged it as an image-server availability issue and linked craft-providers#211 for better error messaging; still open.

Suggested action: keep open

Reason: Maintainer mr-cal triaged it on 2024-11-19, explaining the failure occurs on non-amd64 platforms or when image servers are unavailable, and explicitly linked the open tracking issue craft-providers#211 for improving how the error is presented. The issue is acknowledged and valid, with its actionable fix tracked in an open upstream issue, so it should remain open despite ~17 months of inactivity.

Impact: 45 Quick Win: 27.0 Staleness: 70 Complexity: 40 Confidence: 80 Support Request: 20

Issue body

### Bug Description I'm on 22.04, trying to build a core20 snap, and snapcraft fails to launch a `snapcraft` instance. Turns out it doesn't exist after snapcraft finished configuring multipass: ``` ~/grafana-agent-snap> snapcraft Support for 'multipass' needs to be set up. Would you like to do it now? [y/N]: y snapd is not logged in, snap install commands will use sudo multipass 1.14.1 from Canonical✓ installed Waiting for multipass... Launching a VM. launch failed: Remote "snapcraft" is unknown or unreachable. If image mirror is enabled, please confirm it is valid. 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. ~/grafana-agent-snap> multipass list No instances found. ``` Moreover, the multipass instance name isn't "snapcraft" but rather "snapcraft-<snap_name>": ``` ~/grafana-agent-snap> snapcraft Launching a VM. Build environment is in unknown state, cleaning first. info failed: The following errors occurred: instance "snapcraft-grafana-agent" does not exist Launched: snapcraft-grafana-agent ``` ### To Reproduce From a host that doens't have multipass pre-installed: ```bash git clone https://github.com/canonical/grafana-agent-snap.git cd grafana-agent-snap ./make-classic.sh snapcraft ``` ### Environment Ubuntu 22.04.5 Snapcraft 8.4.4 (12961) ### snapcraft.yaml ```yaml name: grafana-agent version: '0.40.4' summary: A telemetry collector for sending metrics, logs, and trace data license: Apache-2.0 contact: simon.aronsson@canonical.com issues: https://github.com/canonical/grafana-agent-snap/issues source-code: https://github.com/canonical/grafana-agent-snap website: https://grafana.com description: "Grafana Agent is a telemetry collector for sending metrics, \nlogs, and trace data to the opinionated Grafana observability stack.\n" base: core20 grade: stable confinement: classic compression: lzo apps: grafana-agent: daemon: simple command: agent-wrapper install-mode: disable restart-condition: on-failure architectures: - build-on: amd64 - build-on: arm64 parts: wrapper: plugin: dump source: ./snap/local source-type: local override-build: | cp agent-wrapper.classic $SNAPCRAFT_PART_INSTALL/agent-wrapper grafana-agent: plugin: go source: https://github.com/grafana/agent source-type: git source-tag: "v0.40.4" build-snaps: - go/1.22/stable build-packages: - build-essential - libsystemd-dev stage-packages: - libsystemd0 override-build: | export USE_CONTAINER=0 export GOFLAGS="-mod=readonly -tags=promtail_journal_enabled" make agent agentctl cp build/grafana-agent $SNAPCRAFT_PART_INSTALL/agent cp build/grafana-agentctl $SNAPCRAFT_PART_INSTALL/agentctl ``` ### Relevant log output ```shell (Inlined in bug description) ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 27.0
Staleness: 70
Complexity: 40
Confidence: 80
Support Request: 20
keep open Snapcraft fails to launch a multipass VM with 'Remote snapcraft is unknown or unreachable' when multipass is installed on-demand. Maintainer triaged it as an image-server availability issue and linked craft-providers#211 for better error messaging; still open.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 10
keep open snapcraft fails to launch multipass VM when multipass is installed on-demand. Error indicates unreachable image server or unknown remote. Acknowledged by maintainer, linked to craft-providers issue for better error messaging.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 20
keep open Snapcraft fails to launch a multipass instance when multipass isn't pre-installed, citing unreachable remote and instance naming mismatches. Maintainer acknowledged the error and linked it to a tracking issue for improved error messaging.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 55
Confidence: 90
Support Request: 10
keep open snapcraft fails to launch multipass VMs when multipass is not pre-installed, showing unclear remote unreachable errors. Acknowledged and linked to craft-providers issue #211 for better error messaging. Internal ticket CRAFT-3705 created for tracking.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#4106 (confidence 85%)

    Cited by the maintainer as a similar report; closed after the transient Multipass remote error resolved itself, confirming the image-availability root cause.

  • Blocked By: craft-providers#211 (confidence 80%)

    Maintainer's comment points to this open issue ('multipass: better error handling when images are unavailable') as where the error-presentation fix is tracked; it is still open.

Related issues

Issue Project State Summary Similarity
#1806083 snapcraft fails to locate multipass (inside a multipass session) snapcraft (launchpad) open snapcraft 3.0.1 fails to detect an installed multipass when run inside a multipass VM, prompting to install and dropping the user into a shell. No maintainer activity for ~7 years; affected version is long obsolete.
84%
#1810915 snapcraft can't tell when multipass is installed but disabled snapcraft (launchpad) open Snapcraft fails to detect a disabled multipass snap, prompting to install it and then erroring out. Reported against multipass 2018.12.1 / ~2019 snapcraft; untriaged, 0 comments, no labels, inactive for ~7.6 years.
82%
#4106 Error 2 on snapcraft on linux with multipass: snapcraft closed Resolved as fixed after a temporary Multipass remote image unavailability cleared. The reporter closed the issue.
82%
#1813979 snapcraft cleanbuild wants to install multipass but it's already installed snapcraft (launchpad) closed Closed without resolution. Likely abandoned or superseded by newer snapcraft and multipass versions that resolved the detection and launch failures.
80%
#1904774 Snapcraft runs multipass setup but fails snapcraft (launchpad) closed Abandoned. Snapcraft failed during multipass VM cleanup after reporting a missing instance. Closed without comments or fixes.
79%
#1803708 Snapcraft should detect being run inside multipass and error snapcraft (launchpad) closed Rejected. Maintainers disagreed, noting users may legitimately run snapcraft inside multipass VMs. The issue was closed without implementation.
78%
#1984223 Snapcraft on riscv64 tries to install non-existent multipass snap snapcraft (launchpad) open Snapcraft on riscv64 prompts for multipass setup instead of using lxd as default provider. Issue is 4+ years old with no maintainer interaction.
76%
#1856594 Snapcraft tutorial errors out on OSX with multipass error, "returned exit code 2" snapcraft (launchpad) open Dec 2019 report: snapcraft 3.9 on macOS fails via multipass (apt 404s, mount exit code 2) and crashes with AttributeError on os.sched_getaffinity. No maintainer activity; that code path no longer exists in current snapcraft, and macOS support was dropped.
75%
#1859427 'multipass' does not exist or is not available on the desired channel 'latest/beta' snapcraft (launchpad) closed Abandoned after 135 days of inactivity. The report describes a snapcraft channel resolution error when installing multipass, though manual installation works. No fix or discussion was provided.
75%
#1975468 Snapcraft build fails, because multipass cannot download cloudimg snapcraft (launchpad) closed Closed without resolution or comments. The Multipass cloud image download failure was not addressed, indicating the issue was abandoned or resolved externally.
75%