← Back to issue list

Snapcraft fails if Ubuntu Advantage/Pro is configured

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1992660
Type
issue
State
closed
Author
~itrue
Labels
craft-1421
Created
Updated
Closed

Current evaluation

Closed without a code fix: maintainers deemed Ubuntu Pro permissions in legacy destructive builds an environment responsibility; LXD and Multipass builds remained supported.

Resolution: closed not a bug

Reason: In mr-cal's 2022-11-09 comments, maintainers identified the root-only Ubuntu Pro APT credential as the cause and stated that destructive-build users must adjust permissions or run as root. LXD and Multipass remained supported.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Running snapcraft on 20.04 with destructive mode inside a system with Ubuntu Pro enabled does not work, producing the following output: $ snapcraft --destructive-mode *EXPERIMENTAL* --target-arch for core20 enabled. Sorry, an error occurred in Snapcraft: [('/etc/apt/auth.conf.d/90ubuntu-advantage', '/home/itrue/.cache/snapcraft/stage-packages/etc/apt/auth.conf.d/90ubuntu-advantage', "[Errno 13] Permission denied: '/etc/apt/auth.conf.d/90ubuntu-advantage'")] We would appreciate it if you anonymously reported this issue. No other data than the traceback and the version of snapcraft in use will be sent. Would you like to send this error data? (Yes/No/Always/View) [no]: ^C You can find the traceback in file '/tmp/tmpqfbx_v6a/trace.txt'. Contents of the trace file: Traceback (most recent call last):   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/cli/legacy.py", line 27, in legacy_run     run()   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 1130, in __call__     return self.main(*args, **kwargs)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 1055, in main     rv = self.invoke(ctx)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 1635, in invoke     rv = super().invoke(ctx)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 1404, in invoke     return ctx.invoke(self.callback, **ctx.params)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 760, in invoke     return __callback(*args, **kwargs)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func     return f(get_current_context(), *args, **kwargs)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/cli/_runner.py", line 130, in run     snap_command.invoke(ctx)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 1404, in invoke     return ctx.invoke(self.callback, **ctx.params)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/click/core.py", line 760, in invoke     return __callback(*args, **kwargs)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/cli/lifecycle.py", line 387, in snap     _execute(steps.PRIME, parts=tuple(), pack_project=True, output=output, **kwargs)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/cli/lifecycle.py", line 102, in _execute     lifecycle.execute(step, project_config, parts)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 145, in execute     executor.run(step, part_names)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 199, in run     self._handle_step(part_names, part, step, current_step, cli_config)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 213, in _handle_step     getattr(self, "_run_{}".format(current_step.name))(part)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 255, in _run_pull     self._run_step(step=steps.PULL, part=part, progress="Pulling")   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 353, in _run_step     self._prepare_step(step=step, part=part)   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/lifecycle/_runner.py", line 344, in _prepare_step     preparation_function()   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/pluginhandler/__init__.py", line 489, in prepare_pull     self._fetch_stage_packages()   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/pluginhandler/__init__.py", line 468, in _fetch_stage_packages     self.stage_packages = self._stage_packages_repo.fetch_stage_packages(   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/_deb.py", line 464, in fetch_stage_packages     with AptCache(   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/apt_cache.py", line 53, in __enter__     self._populate_stage_cache_dir()   File "/snap/snapcraft/8210/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/apt_cache.py", line 123, in _populate_stage_cache_dir     shutil.copytree("/etc/apt", cache_etc_apt_path)   File "/snap/snapcraft/8210/usr/lib/python3.8/shutil.py", line 557, in copytree     return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,   File "/snap/snapcraft/8210/usr/lib/python3.8/shutil.py", line 513, in _copytree     raise Error(errors) shutil.Error: [('/etc/apt/auth.conf.d/90ubuntu-advantage', '/home/itrue/.cache/snapcraft/stage-packages/etc/apt/auth.conf.d/90ubuntu-advantage', "[Errno 13] Permission denied: '/etc/apt/auth.conf.d/90ubuntu-advantage'")]

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Closed without a code fix: maintainers deemed Ubuntu Pro permissions in legacy destructive builds an environment responsibility; LXD and Multipass builds remained supported.
stealth/space-bunny-alpha — closed not a bug Closed without a code fix; maintainers classified destructive legacy builds with Ubuntu Pro as an environment responsibility, while LXD and Multipass remained supported.
stealth/space-bunny-alpha — closed stale Closed with no documented fix after Ubuntu Advantage/Pro’s protected APT auth file blocked destructive mode; matching LaunchPad report snapcraft#1992660 was also closed without a resolution.
qwen/qwen3.6-35b-a3b — — Closed without documented resolution. Snapcraft still fails with a permission error when copying Ubuntu Advantage apt config files during destructive mode. Likely abandoned or superseded.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. Snapcraft crashes in destructive mode on Ubuntu Pro systems due to a permission denied error copying auth configuration files. No fix or PR provided, indicating the report was abandoned.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The permission denied error when copying Ubuntu Advantage configuration during destructive mode remains unfixed.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned due to inactivity. Snapcraft crashes with a permission denied error when copying the Ubuntu Advantage apt configuration during destructive mode builds. The bug remains unfixed.

Update history

Date Change
created

Related issues

Issue Project State Summary Similarity
#1992213 Snapcraft crashes when the APT unprivileged user owns the host's source list file instead of root snapcraft (launchpad) open Snapcraft 8187 crashed opening a 0600 _apt-owned APT metadata file. The legacy LXD path was removed, but equivalent current apt-cache checks still need review.
72%
#1822372 Snapcraft cleanbuild on Arch Linux with LXD - AppArmor permission error snapcraft (launchpad) closed LP #1822372 closed as not-a-bug/stale: reporter resolved the AppArmor error with an LXD profile workaround (security.nesting/privileged, raw.lxc cgroup lines); maintainer later closed it noting cleanbuild was removed as builds are clean by default.
72%
#1907721 Snapcraft broken on ARM64 snapcraft (launchpad) closed Closed as a configuration issue: a system-wide Python package broke apt-installed Snapcraft, while Multipass lacked ARM64 support; maintainers recommended the Snapcraft snap and --use-lxd.
71%
#1866300 snapcraft fails to build core20 snap snapcraft (launchpad) closed Closed without a documented fix after core20 Multipass/LXD failures; core20 build-base support was unavailable and the workaround was destructive mode.
71%
#5420 Snapcraft 7 fails to launch a LXD container based on host apt sources entries snapcraft closed Closed as a duplicate of canonical/snapcraft#4408; no separate fix was made for this report.
70%
#1788654 snapcraft cleanbuild doesn't work with cross-compile stage-packages snapcraft (launchpad) closed Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded.
70%