Provide better errors for failures to clear the apt cache
Metadata
Current evaluation
Request to wrap the apt-cache cleanup in craft_parts/packages/apt_cache.py with try/except to emit a clearer error when the cache cannot be removed (e.g. destructive mode run with sudo then without). Unlabeled, no maintainer response; related snapcraft issue closed as superseded by craft-application#974.
Suggested action: needs triage
Reason: No labels, no assignee, and the only comment is the Jira-sync bot (CRAFT-2937), so no maintainer has assessed it. The referenced block (shutil.rmtree of cache_etc_apt_path in _populate_stage_cache_dir) is still unguarded in current code, though craft-application#974 now warns on non-root destructive runs, mitigating the original trigger.
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.8-27b |
Impact:
30
Quick Win:
24.0
Staleness:
65
Complexity:
20
Confidence:
70
Support Request:
10
|
needs triage | Request to wrap the apt-cache cleanup in craft_parts/packages/apt_cache.py with try/except to emit a clearer error when the cache cannot be removed (e.g. destructive mode run with sudo then without). Unlabeled, no maintainer response; related snapcraft issue closed as superseded by craft-application#974. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
85
Complexity:
15
Confidence:
80
Support Request:
10
|
needs triage | Enhancement request to improve error messages when apt-cache removal fails during destructive mode operations. Open for ~2.5 years with no maintainer labels, assignment, or response. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
20
Confidence:
80
Support Request:
10
|
needs triage | Enhancement to improve error messages when apt cache clearing fails, particularly in destructive mode. Untriaged, unlabelled, and inactive for over a year. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
82
Complexity:
12
Confidence:
78
Support Request:
5
|
keep open | Add actionable error handling when Craft-parts fails to clear the apt cache, resolving destructive mode permission issues. Currently open, unassigned, untriaged, and stale with no recent activity. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#4558
(confidence 90%)
Explicitly referenced in the issue body; closed as superseded by craft-application#974, which warns when running destructive mode without root.
-
Related To:
canonical/craft-parts#1194
(confidence 60%)
fix: correct file permissions for the apt cache — addresses permission-related apt cache problems, though not the error-message improvement requested here.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4558 Provide better errors for failures to clear the apt cache | snapcraft | closed | Superseded by snapcraft 8.14, which now warns when running destructive mode as a non-root user. The related improvement was merged in canonical/craft-application#974, providing clearer guidance for cache permission issues. | |
| #3528 apt cache: improve error handling when packages do not have candidates available (CRAFT-136) (CRAFT-218) | snapcraft | merged | Merged apt cache error handling that adds null checks for package candidates, preventing crashes when versions are unavailable. The change raises a clear PackageNotFoundError and optimizes unmarking logic, resolving multiple internal bug reports. |