Error 2 on snapcraft on linux with multipass:
Metadata
Current evaluation
Resolved as fixed after a temporary Multipass remote image unavailability cleared. The reporter closed the issue.
Suggested action: —
No scores available.
Issue body
**Please log issues on the project's [bug tracker](https://bugs.launchpad.net/snapcraft)**
Alternatively, If you are looking for support, try [posting on the forums](https://forum.snapcraft.io)
I found my issue here:
https://askubuntu.com/questions/1460377/launch-failed-remote-snapcraft-is-unknown-or-unreachable-multipass-returned
and similar here:
https://forum.snapcraft.io/t/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/30155/3
I get an error while run the snapcraft with multipass:
The error is come that snapcraft doesn't give the correct image name.
I didn't sure if you meant to `core22` or `22.04` both images are in multipass.
I have a workaround, to create the image with snapcraft chosen name and `22.04` image:
```
multipass launch 22.04 --name snapcraft-boinc-on-amd64-for-amd64-33569008 --cpus 2 --mem 2G --disk 64G
```
The error before the workaround:
```
> snapcraft --verbosity verbose pack --build-for amd64
Starting Snapcraft 7.3.1
Logging execution to '/home/tal/.local/state/snapcraft/log/snapcraft-20230419-042442.656224.log'
Running on amd64 for amd64
Launching instance... | (4.6s) Traceback (most recent call last):
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/multipass.py", line 183, in launch
self._run(command)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/multipass.py", line 66, in _run
return subprocess.run(command, check=True, capture_output=True, **kwargs)
File "/snap/snapcraft/8931/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['multipass', 'launch', 'snapcraft:22.04', '--name', 'snapcraft-boinc-on-amd64-for-amd64-33569008', '--cpus', '2', '--mem', '2G', '--disk', '64G']' returned non-zero exit status 2.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/snap/snapcraft/8931/bin/snapcraft", line 8, in <module>
sys.exit(run())
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/cli.py", line 243, in run
_run_dispatcher(dispatcher)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/cli.py", line 219, in _run_dispatcher
dispatcher.run()
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 448, in run
return self._loaded_command.run(self._parsed_command_args)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 259, in run
super().run(parsed_args)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 132, in run
parts_lifecycle.run(self.name, parsed_args)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 215, in run
_run_command(
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 256, in _run_command
_run_in_provider(project, command_name, parsed_args)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 540, in _run_in_provider
with provider.launched_environment(
File "/snap/snapcraft/8931/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/multipass_provider.py", line 105, in launched_environment
instance = launch(
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/_launch.py", line 76, in launch
instance.launch(
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/multipass_instance.py", line 309, in launch
self._multipass.launch(
File "/snap/snapcraft/8931/lib/python3.8/site-packages/craft_providers/multipass/multipass.py", line 185, in launch
raise MultipassError(
craft_providers.multipass.errors.MultipassError: Failed to launch VM 'snapcraft-boinc-on-amd64-for-amd64-33569008'.
* Command that failed: 'multipass launch snapcraft:22.04 --name snapcraft-boinc-on-amd64-for-amd64-33569008 --cpus 2 --mem 2G --disk 64G'
* Command exit code: 2
* Command output: b'warning: "--mem" long option will be deprecated in favour of "--memory" in a future release.Please update any scripts, etc.\n\r
* Command standard error output: b'launch failed: Remote "snapcraft" is unknown or unreachable.\n'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Resolved as fixed after a temporary Multipass remote image unavailability cleared. The reporter closed the issue. | |
| qwen/qwen3.6-35b-a3b | — | — | The author closed the issue after the transient Multipass remote error resolved itself, confirming it was a temporary service glitch. A maintainer advised ARM64 users to open a separate report for similar image availability problems. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after the multipass snapcraft image registry recovered. CI passed, the reporter confirmed functionality returned, and the failure was attributed to a temporary upstream connectivity issue. ARM64 users were directed elsewhere. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed by author after the transient Multipass remote connectivity error resolved itself. Snapcraft successfully launched the VM once the external service stabilized. The problem was attributed to a temporary Multipass outage rather than a code defect. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as resolved after the transient Multipass image error fixed itself. The author confirmed no code changes were needed and attributed the failure to Multipass infrastructure. Related arm64 inquiries were redirected to a new issue. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5145 snapcraft fails to launch multipass instance when multipass isn't pre-installed | snapcraft | 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. | |
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #1794361 use new multipass snapcraft remote | snapcraft (launchpad) | closed | Closed without resolution or comments. The request to configure the new multipass snapcraft remote and default missing bases to core16 was likely abandoned or superseded. |