← Back to issue list

Cannot run snapcraft in docker anymore

View original Github issue

Metadata

Project
snapcraft
Number
#5079
Type
issue
State
open
Author
om26er
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Snapcraft extracted into Docker fails with a snapctl/snapd-socket internal error; a custom Python-module launcher workaround succeeds, while a maintainer keeps the triaged issue open to improve errors.

Suggested action: keep open

Reason: The reporter confirmed Docker builds work after changing the custom launcher to invoke the bundled Python with `-m snapcraft`, so there is a workaround but also an opaque internal error. The issue is labeled Status: Triaged, and @mr-cal explicitly said it should remain open because error handling can be improved. Although current `snapcraft/snap_config.py` catches `SnapCtlError` for its own config path, the reported traceback passes through craft-application/snaphelpers, leaving the implementation boundary and expected diagnostic unspecified.

Evaluated by: mr-cal-bot

Impact: 42 Quick Win: 14 Complexity: 52 Confidence: 94 Actionability: 70

Issue body

### Bug Description I cannot run snapcraft in docker container anymore. It requires snapd to be running. ### To Reproduce Build a docker container with snapcraft in it and then use that docker container to build a snap ### Environment Docker with noble based image ### snapcraft.yaml ```yaml no yaml config needed ``` ### Relevant log output ```shell root@d04e7a25f671:/datax# SNAP_INSTANCE_NAME=snapcraft snapcraft version snapcraft internal error: SnapCtlError('Call to snapctl failed with error 1: error: cannot communicate with server: Post "http://localhost/v2/snapctl": dial unix /run/snapd-snap.socket: connect: no such file or directory\n') Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240930-150845.117122.log' Traceback (most recent call last): File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/application.py", line 568, in run return_code = self._run_inner() File "/snap/snapcraft/current/lib/python3.10/site-packages/snapcraft/application.py", line 215, in _run_inner return_code = super()._run_inner() File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/application.py", line 521, in _run_inner platform = self.get_arg_or_config(parsed_args, "platform") File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/application.py", line 511, in get_arg_or_config return self.services.config.get(item) File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/services/config.py", line 175, in get value = handler.get_raw(item) File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/services/config.py", line 103, in get_raw return self._snap.get(snap_item) File "/snap/snapcraft/current/lib/python3.10/site-packages/snaphelpers/_conf.py", line 125, in get options = self.get_options(top_key) File "/snap/snapcraft/current/lib/python3.10/site-packages/snaphelpers/_conf.py", line 114, in get_options options.fetch() File "/snap/snapcraft/current/lib/python3.10/site-packages/snaphelpers/_conf.py", line 86, in fetch self._config = self._snapctl.config_get(*self._keys) File "/snap/snapcraft/current/lib/python3.10/site-packages/snaphelpers/_ctl.py", line 147, in config_get conf = json.loads(self.run("get", "-d", *keys)) File "/snap/snapcraft/current/lib/python3.10/site-packages/snaphelpers/_ctl.py", line 271, in run raise SnapCtlError(process) snaphelpers._ctl.SnapCtlError: Call to snapctl failed with error 1: error: cannot communicate with server: Post "http://localhost/v2/snapctl": dial unix /run/snapd-snap.socket: connect: no such file or directory ``` ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 42
Quick Win: 14
Complexity: 52
Confidence: 94
Actionability: 70
keep open Snapcraft extracted into Docker fails with a snapctl/snapd-socket internal error; a custom Python-module launcher workaround succeeds, while a maintainer keeps the triaged issue open to improve errors.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 20
Complexity: 30
Confidence: 90
Actionability: 70
keep open Triaged enhancement to improve error handling when snapcraft runs in Docker without snapd. Maintainer acknowledged and requested to keep open.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 30
Staleness: 65
Complexity: 40
Confidence: 75
Support Request: 40
keep open Snapcraft crashes with SnapCtlError when run in Docker without snapd; reporter found a working Dockerfile workaround, maintainer kept it open to improve error handling. Triaged as enhancement, last activity 493 days ago.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 30
Confidence: 90
Support Request: 20
keep open Snapcraft fails in Docker due to missing snapd socket. User resolved via Dockerfile workaround. Maintainer acknowledged and requested keeping it open for error handling improvements.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 90
Support Request: 0
keep open Triaged enhancement to improve error handling when snapcraft runs in Docker without snapd. Maintainer explicitly requested it remain open for future implementation.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#6419 (confidence 78%)

    Both report Docker failures involving the Snapcraft launcher environment; #6419 concerns sudo/destructive mode and has no confirmed shared root cause or fix.

Related issues

Issue Project State Summary Similarity
#1956216 Snapcraft is no longer working within a Docker container snapcraft (launchpad) closed Reporter's own PR snapcore/snapcraft#3607 (branch launchpad-bug-1956216) fixed the Docker breakage by correcting the Python install/PATH and site-packages, merged as 808d3b399 (commit 6f2dc4445 "docker: fix python installation").
74%