multipass: fix setup exception when multipass is not found in PATH
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix for a FileNotFoundError during multipass setup when /snap/bin is missing from PATH. Raises a SnapcraftEnvironmentError with a clear PATH check message and refactors the wait loop to reduce complexity. |
Update history
No update history recorded yet.
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. | |
| #211 multipass: better error handling when images are unavailable | craft-providers | open | Enhancement to improve error handling and user guidance when Multipass snapcraft images are unavailable or unsupported on non-amd64 architectures. Currently open with maintainer discussion and downstream reports. | |
| #1791821 multipass should use snapcraft defined environments | snapcraft (launchpad) | closed | Closed without discussion or resolution, indicating the feature request was likely abandoned or superseded. The proposal to align multipass with snapcraft-defined build images received no further action. | |
| #3381 multipass build provider: check if instance exists before deleting | snapcraft | merged | Merged a Snapcraft fix adding an existence check before deleting Multipass instances, preventing errors when missing. Addresses LP #1904774. Reviewers suggested extra features and warnings, but the core fix was approved and merged. |