Snapcraft crashes when the APT unprivileged user owns the host's source list file instead of root
Metadata
Current evaluation
Snapcraft crashes when APT source list files have restrictive permissions (owned by _apt user with 0600). Issue is 4 years old with no maintainer response.
Suggested action: close stale
Reason: Issue is 1426 days old with zero maintainer engagement, no labels, and no comments. The traceback references snapcraft_legacy code paths which have likely been refactored or removed in modern snapcraft. The underlying issue involves APT's unprivileged user sandbox permissions, which is a system-level behavior rather than a snapcraft bug.
Impact:
25
Quick Win:
16.25
Staleness:
95
Complexity:
35
Confidence:
65
Support Request:
45
Issue body
```
File "/snap/snapcraft/8187/lib/python3.8/site-packages/snapcraft_legacy/cli/lifecycle.py", line 112, in _execute
build_provider_class.ensure_provider()
File "/snap/snapcraft/8187/lib/python3.8/site-packages/snapcraft_legacy/internal/build_providers/_lxd/_lxd.py", line 90, in ensure_provider
if repo.Repo.is_package_installed("lxd") or repo.Repo.is_package_installed(
File "/snap/snapcraft/8187/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/_deb.py", line 506, in is_package_installed
with AptCache() as apt_cache:
File "/snap/snapcraft/8187/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/apt_cache.py", line 58, in __enter__
self.cache = apt.Cache()
File "/snap/snapcraft/8187/lib/python3.8/site-packages/apt/cache.py", line 170, in __init__
self.open(progress)
File "/snap/snapcraft/8187/lib/python3.8/site-packages/apt/cache.py", line 232, in open
self._cache = apt_pkg.Cache(progress)
apt_pkg.Error: E:can not open /var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_jammy_InRelease - fopen (13: Permission denied), E:The package lists or status file could not be parsed or opened.
```
See the attached file for full traces. It appears that the source file it reads is not world-readable, thus the error:
```
brlin@brlin-mz-530:~/文件/iscan-snap/snap$ LANG=C stat /var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_jammy_InRelease
File: /var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_jammy_InRelease
Size: 270087 Blocks: 528 IO Block: 4096 regular file
Device: 1ch/28d Inode: 208286 Links: 1
Access: (0600/-rw-------) Uid: ( 105/ _apt) Gid: ( 0/ root)
Access: 2022-10-08 07:10:46.083036717 +0800
Modify: 2022-04-22 01:16:39.000000000 +0800
Change: 2022-10-08 07:10:46.059036185 +0800
Birth: 2022-08-11 12:46:23.140062113 +0800
brlin@brlin-mz-530:~/文件/iscan-snap/snap$ LANG=C ls -l /var/lib/apt/lists/
...stripped...
-rw-r--r-- 1 root root 771595 Oct 6 09:36 tw.archive.ubuntu.com_ubuntu_dists_jammy-updates_universe_i18n_Translation-en
-rw------- 1 _apt root 270087 Apr 22 01:16 tw.archive.ubuntu.com_ubuntu_dists_jammy_InRelease
-rw-r--r-- 1 root root 6779186 Apr 19 08:52 tw.archive.ubuntu.com_ubuntu_dists_jammy_main_binary-amd64_Packages
-rw-r--r-- 1 root root 4931270 Apr 19 08:52 tw.archive.ubuntu.com_ubuntu_dists_jammy_main_binary-i386_Packages
```
The `_apt` user supposed to be "unprivileged user for the apt methods"[1], whatever that means.
[1]: apt - What is the sandbox user '_apt' on my system - Ask Ubuntu
https://askubuntu.com/questions/810202/what-is-the-sandbox-user-apt-on-my-system
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
25
Quick Win:
16.25
Staleness:
95
Complexity:
35
Confidence:
65
Support Request:
45
|
close stale | Snapcraft crashes when APT source list files have restrictive permissions (owned by _apt user with 0600). Issue is 4 years old with no maintainer response. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
20
Confidence:
80
Support Request:
10
|
close stale | Snapcraft crashes with an apt_pkg permission error when reading host APT list files owned by the unprivileged _apt user. The report is nearly 4 years old, references snapcraft_legacy, and has had no maintainer response or updates. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
40
Confidence:
85
Support Request:
10
|
close stale | Bug report about Snapcraft crashing due to APT file permissions owned by _apt user. Issue is 3.8 years old, no activity, references legacy code. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
20
Confidence:
85
Support Request:
20
|
close stale | Untriaged crash report from 2022 where snapcraft fails due to APT list file permissions. References legacy code and outdated revision 8187. No maintainer engagement. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
15
Confidence:
85
Support Request:
10
|
close stale | Snapcraft crashes with apt permission denied when APT list files are owned by the _apt user with restrictive permissions. Unmaintained for over 3 years with no maintainer response. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1583236 snapcraft APT sources checking too strict | snapcraft (launchpad) | open | snapcraft fails builds when APT exits nonzero for non-critical warnings (e.g., outdated hash functions, unsupported PPAs). Unlabelled, zero comments, no maintainer interaction; references obsolete 2015-era sources. | |
| #1980536 snapcraft unusable on systems not using apt | snapcraft (launchpad) | closed | Closed without resolution. Snapcraft retained hard apt dependencies, causing crashes on non-Debian systems like Arch Linux. The issue appears abandoned with no fix provided. | |
| #1638840 snapcraft copies /etc/apt/sources but ignores /etc/apt/preferences | snapcraft (launchpad) | open | Snapcraft copies /etc/apt/sources but ignores /etc/apt/preferences, causing wrong package selection in complex setups. 9.8 years old, zero comments, no labels, no maintainer interaction. Current codebase uses craft-archives with AptPreferencesManager, a completely different architecture. | |
| #1992660 Snapcraft fails if Ubuntu Advantage/Pro is configured | snapcraft (launchpad) | closed | 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. | |
| #1867052 Snapcraft crashes while creating snap for ssh-audit | snapcraft (launchpad) | closed | Snapcraft v2.43.1 crashes with FileNotFoundError during snap packaging due to a missing executable path in snapcraft.yaml. Issue is completely inactive for over 6 years. | |
| #1800119 snapcraft cleanbuild | snapcraft (launchpad) | closed | Closed without resolution. The report details a PermissionError during snapcraft cleanbuild caused by restricted access to the .aptitude directory. With zero comments and no fix applied, the issue was abandoned or marked stale. |