snap config: do not crash when config cannot be retrieved
Metadata
Current evaluation
Merged PR #3971 as commit 1aec6c84b, preventing Snapcraft from crashing when snap config retrieval fails because snapd is unavailable in Docker.
Resolution: closed resolved
Reason: PR #3971 was merged as commit 1aec6c84b. It catches and logs snap-config retrieval errors so Docker environments without snapd continue without crashing.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
Make the `get_snap_config()` function more robust.
In docker containers, snapcraft appears to be installed as a snap, but `snapd` is not available and it causes `snaphelpers` to raise an error when fetching the snap config. Now, those errors are caught and logged without crashing.
https://github.com/snapcore/snapcraft/pull/3903 broke snapcraft in docker, which was reported [here](https://forum.snapcraft.io/t/snapcraft-7-2-depends-on-snapd-socket-at-runtime/32382) and [here](https://forum.snapcraft.io/t/call-for-testing-snapcraft-7-2-0/32171/16).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3971 as commit 1aec6c84b, preventing Snapcraft from crashing when snap config retrieval fails because snapd is unavailable in Docker. | |
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft now catches and logs snap-config retrieval errors instead of crashing when snapd is unavailable in Docker. Merged in PR #3971 via commit 1aec6c84b. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3971 (1aec6c84b), making get_snap_config() catch and log snapd configuration retrieval errors so Docker environments without snapd no longer crash. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Fixed a crash in get_snap_config() when snapd is unavailable by catching and logging errors. Approved by reviewer and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Updates get_snap_config() to catch snaphelpers errors when snapd is unavailable, preventing crashes in Docker environments. Resolves a regression from PR #3903 by logging failures instead of crashing, avoiding internal name access. |
Update history
No update history recorded yet.
Related work
-
Caused By:
snapcraft#3903
(confidence 99%)
The PR description identifies #3903 as the change that introduced the Docker regression.
-
Related To:
snapcraft#3974
(confidence 98%)
Merged follow-up PR broadened the snap-config retrieval errors handled.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3974 snap config: catch more errors when config cannot be retrieved | snapcraft | merged | Merged in #3974 (commit 3a1ed84d5), broadening snap configuration error handling to catch additional retrieval failures identified after #3971. | |
| #3210 docker: install snapd dependency | snapcraft | merged | Merged PR #3210 in commit 42d3861a, adding snapd to Snapcraft Docker images so required snap pack operations continue working. | |
| #2457 lifecyle: avoid installation of snaps in docker | snapcraft | merged | Merged PR #2457 (commit bacf47f7a): Snapcraft now detects Docker environments and warns users instead of attempting snap installation without snapd. |