Persistent container builds are broken
Metadata
Current evaluation
Persistent LXD builds were fixed by canonical/snapcraft#1847 (commit e7d73a365), correcting user handling for remote SSHFS-mounted containers.
Resolution: closed resolved
Reason: PR #1847 was merged as commit e7d73a365 and changed remote SSHFS container setup to use the container user, addressing the invalid command argument that caused shlex.quote to fail.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Get this every time:
Device /root/build_my-snap-name removed from snapcraft-my-snap-name
Waiting for a network connection...
Network connection established
Mounting /tmp/foo into container
Device /root/build_my-snap-name added to snapcraft-my-snap-name
Stopping local:snapcraft-my-snap-name
Sorry, Snapcraft ran into an error when trying to running through its
lifecycle that generated the following traceback:
Traceback (most recent call last):
File "/home/kyrofa/venv/snapcraft/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft', 'console_scripts', 'snapcraft')()
File "/home/kyrofa/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/kyrofa/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/kyrofa/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/kyrofa/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/kyrofa/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/kyrofa/src/snapcraft/snapcraft/cli/lifecycle.py", line 116, in prime
_execute(steps.PRIME, parts, **kwargs)
File "/home/kyrofa/src/snapcraft/snapcraft/cli/lifecycle.py", line 38, in _execute
lifecycle.containerbuild(command, project_options, parts)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lifecycle/_containers.py", line 45, in containerbuild
metadata=config.get_metadata()).execute(step, args)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lxd/_containerbuild.py", line 198, in execute
user=self._user)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lxd/_containerbuild.py", line 214, in _container_run
' '.join(pipes.quote(arg) for arg in cmd))]
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lxd/_containerbuild.py", line 214, in <genexpr>
' '.join(pipes.quote(arg) for arg in cmd))]
File "/usr/lib/python3.6/shlex.py", line 314, in quote
if _find_unsafe(s) is None:
TypeError: expected string or bytes-like object
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Persistent LXD builds were fixed by canonical/snapcraft#1847 (commit e7d73a365), correcting user handling for remote SSHFS-mounted containers. | |
| stealth/space-bunny-alpha | — | closed stale | Closed with no documented fix; the LXD persistent-build shlex.quote TypeError remained unresolved. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without comments. The shlex.quote TypeError breaking persistent container builds was abandoned or resolved by unrelated updates. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after fixing a TypeError in shlex.quote that caused persistent container builds to fail. The resolution addressed non-string arguments passed to the LXD container command execution. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed and fixed. The TypeError causing snapcraft persistent container builds to fail was resolved by correcting string handling in the LXD container execution module. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. Persistent LXD container builds failed due to a TypeError when shlex.quote received non-string command arguments. The issue appears abandoned or superseded by later container build refactors. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#1847
(confidence 85%)
Its LXD SSHFS user-handling change matches the failing remote-container mount path.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1700703 container builds fail after creating the container | snapcraft (launchpad) | closed | LXD container-build ID mapping was fixed by snapcore/snapcraft#1385, merged as commit e85e0779b, removing the assumption that the user's UID was 1000. | |
| #1577548 Not creating ephemeral containers | snapcraft (launchpad) | closed | Fixed by merged PR canonical/snapcraft#578 (commit 038bf3f05, "Make lxd containers ephemeral"), shipped in snapcraft 2.12 to xenial -proposed, verified by elopio, then released to -updates. | |
| #1722049 core refresh in container build breaks build | snapcraft (launchpad) | closed | Fixed by merged PR canonical/snapcraft#2098 (commit 7666a74a7), which waits for active snap refreshes before injecting build snaps into reusable LXD containers. | |
| #1741082 sshfs breaks with serving user files to root in LXD | snapcraft (launchpad) | closed | Fixed by merged PR canonical/snapcraft#1847 (commit e7d73a365), creating a matching user for remote LXD sshfs builds so project files are not left root-owned. | |
| #1716738 Persistent container cannot be started | snapcraft (launchpad) | closed | Persistent LXD builds lacked required host /etc/subuid and /etc/subgid mappings; merged PR #1553 added setup instructions after failed starts. | |
| #1461 build as a user in container | snapcraft | closed | Broad non-root LXD builds remained unimplemented: PR #1484 was closed unmerged after design concerns; PR #1847 merged e7d73a365 only for remote sshfs mount ownership. | |
| #1364 lxd: Inject snapcraft and core snaps into the container | snapcraft | merged | Merged PR #1364 as 99f5598ac, injecting the host's Snapcraft and core snaps into LXD containers so builds no longer use a mismatched Xenial archive version. | |
| #719 Snapcraft fails initialization of build container | craft-providers | closed | LXD startup race was fixed by waiting for instance readiness in craft-providers PR #720; the fix shipped via Snapcraft PR #5247 in Snapcraft 8.6.2. | |
| #1624075 cleanbuild - Don't try to stop a non-existent container | snapcraft (launchpad) | closed | Fixed by merged PR canonical/snapcraft#1403, adding an LXD existence check so cleanbuild no longer tries to stop or remove a container that was never created. |