← Back to issue list

multipass: fix setup exception when multipass is not found in PATH

View original Github issue

Metadata

Project
snapcraft
Number
#2694
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged into master as c3e544dc9, handling missing Multipass in PATH with a clear SnapcraftEnvironmentError.

Resolution: closed resolved

Reason: PR #2694 was merged as commit c3e544dc9. It catches the missing-Multipass condition and advises checking the configured PATH.

Evaluated by: mr-cal-bot

No scores available.

Issue body

In setup_multipass, there is a case where multipass installs OK, but then the call to check the version info fails with FileNotFoundError. The most plausible explanation is that the multipass snap installs OK, but /snap/bin is not in the PATH, so multipass is not found. This is easily reproduced. When this occurs, raise SnapcraftEnvironmentError() with an error message suggesting the user check their PATH. Catching this exception was the straw that broke the flake8 "is too complex" check, so move the wait loop into _wait_for_multipass_ready() - and flip "multipass" to cls.provider_cmd for consistency. Fixes SNAPCRAFT-10S Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged into master as c3e544dc9, handling missing Multipass in PATH with a clear SnapcraftEnvironmentError.
stealth/space-bunny-alpha — closed resolved Merged PR #2694 (commit c3e544dc9) fixed Multipass setup when snap/bin is missing from PATH, raising a clear SnapcraftEnvironmentError and refactoring the readiness wait.
qwen/qwen3.6-35b-a3b — — Merged fix for multipass setup failure when binary is installed but missing from PATH. Raises SnapcraftEnvironmentError with PATH guidance, refactors wait loop to reduce complexity, and resolves SNAPCRAFT-10S.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix for multipass setup failure when /snap/bin is absent from PATH. Replaces FileNotFoundError with SnapcraftEnvironmentError and a clear message. Refactored wait loop and standardized variable naming. Resolves SNAPCRAFT-10S.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1791821 multipass should use snapcraft defined environments snapcraft (launchpad) closed Multipass now launches Snapcraft-defined build images; fixed by canonical/snapcraft#2258 (commit 5ffefbf96), including a Darwin launch workaround.
76%
#1806083 snapcraft fails to locate multipass (inside a multipass session) snapcraft (launchpad) open Snapcraft 3.0.1 falsely reported Multipass missing inside a Multipass guest; Darwin-only detection in e9ae8d29f addressed the old path, but the Launchpad record remains open.
74%
#1792614 use multipass if set in the environment snapcraft (launchpad) closed Closed as fixed: PR snapcore/snapcraft#2275 (commit 04f8896d9) made SNAPCRAFT_BUILD_ENVIRONMENT/multipass take precedence over the base-derived provider choice.
73%
#1861011 Multipass bug prevents snapcraft from building on windows when using base keyword snapcraft (launchpad) closed The Windows hang was an upstream Multipass defect; canonical/multipass#1170 fixed it on master for release 1.1.
71%
#211 multipass: better error handling when images are unavailable craft-providers open Multipass launch gives generic errors when Snapcraft images are unreachable or unsupported on arm64; this acknowledged enhancement remains open with a downstream report and internal ticket.
70%