← Back to issue list

cleanbuild - Don't try to stop a non-existent container

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1624075
Type
issue
State
closed
Author
~joetalbott
Labels
cleanbuild
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: PR #1403 was merged and its existence check prevents cleanup from raising a second error when container creation fails. A maintainer explicitly confirmed that the reported problem was fixed by this PR.

Evaluated by: mr-cal-bot

No scores available.

Issue body

josepht@spruce:~/src/bzr/nmap-ubuntu-core/current_work$ snapcraft cleanbuild "confinement" property not specified: defaulting to "strict" "grade" property not specified: defaulting to "stable" error: not found (not a fingerprint, partial fingerprint (first 12 chars) or valid alias) Stopping snapcraft-mainly-handy-cod error: not found Command '['lxc', 'stop', '-f', 'snapcraft-mainly-handy-cod']' returned non-zero exit status 1

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Fixed in snapcore/snapcraft#1403 by making cleanbuild avoid stopping a nonexistent build container.
stealth/space-bunny-alpha — closed resolved Cleanup now checks whether the container exists before stopping it, preventing lxc stop failures during snapcraft cleanbuild.
qwen/qwen3.6-35b-a3b — — Closed. The cleanup routine was updated to check for container existence before stopping it, resolving lxc stop failures during snapcraft cleanbuild.
qwen/qwen3.6-35b-a3b — — Closed without resolution, likely abandoned. The report detailed snapcraft cleanbuild failing when attempting to stop a non-existent LXC container.
qwen/qwen3.6-35b-a3b — — Fixed by adding a pre-check to skip stopping non-existent LXC containers during snapcraft cleanbuild, resolving the exit status 1 error.
qwen3.6-35b-a3b-mtp-q6 — — Resolved by modifying snapcraft to skip stopping non-existent LXC containers during cleanbuild, preventing the command failure. Closed without further comments.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1403 (confidence 100%)

    Merged fix titled “lxd: Only remove container if one exists,” cited by the maintainer as the resolution.

Related issues

Issue Project State Summary Similarity
#1403 lxd: Only remove container if one exists snapcraft merged Merged PR #1403, adding an LXD existence check so failed container creation no longer triggers a second exception while stopping or removing a nonexistent container.
74%
#1796980 Remove cleanbuild snapcraft (launchpad) closed Merged snapcore/snapcraft#2335 as 27ec9ba63, removing LXD lifecycle builds for base-based snaps and making cleanbuild redundant for them.
72%
#1666735 snapcraft cleanbuild does not work with lxd installed via snap snapcraft (launchpad) closed Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata.
72%
#1655 lxd: distinguish argless clean from clean -s pull snapcraft merged Merged in snapcraft#1655 (ed32603c7), fixing LXD cleanup so bare clean removes build containers while clean -s pull preserves or recreates them.
72%
#1587 lifecycle: clean after deleting container snapcraft merged Merged PR #1587 (commit daca4618b): LXD cleanup logic moved into lxd.py's clean() so `snapcraft clean` removes leftover build containers, addressing the forum-reported container-build clean issue.
71%
#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.
71%
#1780997 Persistent container builds are broken snapcraft (launchpad) closed Persistent LXD builds were fixed by canonical/snapcraft#1847 (commit e7d73a365), correcting user handling for remote SSHFS-mounted containers.
70%