← Back to issue list

Snapcraft tutorial errors out on OSX with multipass error, "returned exit code 2"

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1856594
Type
issue
State
open
Author
~dobsorg
Labels
—
Created
Updated
Closed
—

Current evaluation

macOS Multipass bootstrap hits apt 404s and then mount failures, blocking the tutorial; the host-side CPU-affinity crash has a fallback, but the primary failure remains unconfirmed.

Suggested action: keep open

Reason: The report provides a concrete macOS/core18/Snapcraft 3.8 reproduction with apt 404s followed by a mount failure, and maintainer ~sergiusens explicitly said networking was not fully up and that Snapcraft would improve failure exposure and cleanup. Commit fc9799b26 added a fallback for the secondary os.sched_getaffinity crash, but there is no evidence that the underlying Multipass networking/bootstrap failure was fixed.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 13 Complexity: 62 Confidence: 82 Actionability: 62

Issue body

Attempting to run through the Go tutorial on OSX results in the following when running `snapcraft` the first time: ``` Launching a VM. Launched: snapcraft-test-httplab-dobs 2019-12-16T15:57:59Z INFO Waiting for restart... snapd 2.42.5 from Canonical✓ installed core18 20191126 from Canonical✓ installed snapcraft 3.8 from Canonical✓ installed Ign:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Ign:2 http://archive.ubuntu.com/ubuntu bionic InRelease Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Err:4 http://security.ubuntu.com/ubuntu bionic-security Release 404 Not Found [IP: 91.189.91.14 80] Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Err:6 http://archive.ubuntu.com/ubuntu bionic Release 404 Not Found [IP: 91.189.88.24 80] Err:7 http://archive.ubuntu.com/ubuntu bionic-updates Release 404 Not Found [IP: 91.189.88.24 80] Err:8 http://archive.ubuntu.com/ubuntu bionic-backports Release 404 Not Found [IP: 91.189.88.24 80] Reading package lists... Done E: The repository 'http://security.ubuntu.com/ubuntu bionic-security Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Failed to update the package cache: Some files could not be downloaded: failed to run apt update Check that the sources on your host are configured correctly. An error occurred when trying to execute 'sudo -i env SNAPCRAFT_HAS_TTY=True snapcraft refresh' with 'multipass': returned exit code 2. ``` On subsequent runs: ``` Launching a VM. snap "snapd" has no updates available snap "core18" has no updates available snap "snapcraft" has no updates available mount failed: Error enabling mount support in 'snapcraft-test-httplab-dobs' An error occurred with the instance when trying to mount with 'multipass': returned exit code 2. Ensure that 'multipass' is setup correctly and try again. ``` I've confirmed that multipass is running, though unclear how to confirm that it's set up "correctly." Based on others' incidents I attempted to run `snapcraft clean`, the result was the following: ``` Sorry, an error occurred in Snapcraft: module 'os' has no attribute 'sched_getaffinity' Traceback (most recent call last): File "/usr/local/bin/snapcraft", line 8, in <module> sys.exit(run()) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/cli/_command.py", line 87, in invoke return super().invoke(ctx) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/cli/lifecycle.py", line 338, in clean lifecycle.clean(project, parts, steps.PRIME) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/internal/lifecycle/_clean.py", line 198, in clean config = project_loader.load_config(project) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/internal/project_loader/__init__.py", line 47, in load_config return Config(project) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/internal/project_loader/_config.py", line 212, in __init__ self.data = self._expand_env(snapcraft_yaml) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/internal/project_loader/_config.py", line 335, in _expand_env snapcraft_global_environment(self.project) File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/internal/project_loader/_env.py", line 110, in snapcraft_global_environment "SNAPCRAFT_PARALLEL_BUILD_COUNT": str(project.parallel_build_count), File "/usr/local/Cellar/snapcraft/3.9/libexec/lib/python3.7/site-packages/snapcraft/project/_project_options.py", line 135, in parallel_build_count return len(os.sched_getaffinity(0)) AttributeError: module 'os' has no attribute 'sched_getaffinity' We would appreciate it if you created a bug report at https://launchpad.net/snapcraft/+filebug with the above text included. You can find the traceback in file '/var/folders/8t/bcy9yfg90c56_4m_36wmtyrm0000gp/T/tmp4o1p110g/trace.txt'. ``` Which led me here.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 13
Complexity: 62
Confidence: 82
Actionability: 62
keep open macOS Multipass bootstrap hits apt 404s and then mount failures, blocking the tutorial; the host-side CPU-affinity crash has a fallback, but the primary failure remains unconfirmed.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 18
Complexity: 52
Confidence: 79
Actionability: 64
keep open macOS Multipass bootstrap hits apt 404s, followed by mount failures; Snapcraft clean also crashes on missing os.sched_getaffinity. Maintainer-acknowledged, but the primary failure is not confirmed resolved.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 22
Complexity: 20
Confidence: 95
Actionability: 90
close resolved Snapcraft crashes on macOS due to os.sched_getaffinity not being available. Fixed by PR #2963 which adds fallback logic.
qwen/qwen3.8-27b
Impact: 25
Quick Win: 16
Staleness: 95
Complexity: 35
Confidence: 70
Support Request: 45
close stale 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.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 92
Support Request: 65
close stale Snapcraft tutorial fails on macOS due to multipass errors, EOL Ubuntu Bionic repos, and a Python 3.7 macOS compatibility issue. Issue is over 6 years old with no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 95
Support Request: 30
close stale Snapcraft tutorial fails on macOS due to Multipass VM errors, outdated Ubuntu Bionic repositories, and Python 3.7 compatibility issues. No activity for over 6 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 15
Confidence: 95
Support Request: 30
close stale Reported snapcraft and multipass failures on macOS with Ubuntu 18.04 (bionic) repositories and Python compatibility errors. Issue is over 6 years old with no maintainer response.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#2963 (confidence 95%)

    Commit fc9799b26 adds a multiprocessing.cpu_count fallback when os.sched_getaffinity is unavailable, addressing the secondary snapcraft clean crash on macOS.

  • Related To: snapcraft (launchpad)#1904774 (confidence 82%)

    That Multipass setup failure was addressed by canonical/snapcraft#3381, commit 51e75b4de, which checks whether an instance exists before deleting it; it does not establish that this issue's apt networking failure is resolved.

Related issues

Issue Project State Summary Similarity
#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.
72%
#5145 snapcraft fails to launch multipass instance when multipass isn't pre-installed snapcraft open Snapcraft emits cryptic 'Remote "snapcraft" is unknown or unreachable / exit code 2' when Multipass can't launch the build instance; maintainer traced it to image-server unavailability or non-amd64 hosts, fix tracked in craft-providers#211
72%