← Back to issue list

LXD issue when build multiple charms in parallel

View original Github issue

Metadata

Project
craft-providers
Number
#391
Type
issue
State
open
Author
beliaev-maksim
Labels
Type: Bug
Created
Updated
Closed
—

Current evaluation

Parallel LXD charm builds failed with a snapd 'daemon is stopping' error during `snap watch`. Fixed by retrying snap watch in commit e0f6bc7 (PR #899), released in 3.3.0; issue still open awaiting closure.

Suggested action: close resolved

Reason: Commit e0f6bc7 ("fix: retry 'snap watch' (#899)") wrapped the `snap watch --last=auto-refresh?` call in `retry.retry_until_timeout` in `craft_providers/base.py:_disable_and_wait_for_snap_refresh` (lines 616-631), citing the same snapd not-ready window. Its unit test `test_snap_refresh_watch_retry` uses the exact stderr from this report ("daemon is stopping to wait for socket activation"), and the 3.3.0 changelog entry "Fix a bug where snapd would fail while waiting for snap refreshes to complete." documents the shipped fix. The code is present at the pinned HEAD (post-3.7.1), so the reported failure mode is addressed; remaining closure only needs a maintainer to confirm no parallel-build regressions persist.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 33 Complexity: 22 Confidence: 88 Actionability: 78

Issue body

### Bug Description issue in LXD when build multiple projects in parallel ### To Reproduce https://github.com/canonical/knative-operators/actions/runs/6024286376/job/16429412492 ### part yaml _No response_ ### Relevant log output ```shell charmcraft internal error: LXDError(brief='Failed to wait for snap refreshes to complete.\n* Command that failed: "lxc --project charmcraft exec local:charmcraft-knative-operator-146046-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 snap watch \'--last=auto-refresh?\'"\n* Command exit code: 1\n* Command standard error output: b\'error: daemon is stopping to wait for socket activation\\n\'', details=None, resolution=None) ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 33
Complexity: 22
Confidence: 88
Actionability: 78
close resolved Parallel LXD charm builds failed with a snapd 'daemon is stopping' error during `snap watch`. Fixed by retrying snap watch in commit e0f6bc7 (PR #899), released in 3.3.0; issue still open awaiting closure.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 37
Complexity: 30
Confidence: 97
Actionability: 95
close resolved Parallel LXD builds can fail on a snapd socket-activation error; current craft-providers retries the failing snap watch operation and has regression coverage.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 28
Complexity: 22
Confidence: 99
Actionability: 74
close resolved Parallel LXD charm builds can fail while waiting for snap refreshes with a snapd socket-activation error; the current code retries this transient failure.
qwen3.6-35b-a3b-mtp-q6
Impact: 75
Quick Win: 26
Staleness: 45
Complexity: 65
Confidence: 75
Support Request: 10
keep open LXD race condition causing parallel charm build failures; reopened by maintainer after resurfacing in modern Charmcraft
qwen/qwen3.6-35b-a3b
Staleness: 20
Complexity: 60
Confidence: 85
Support Request: 10
keep open LXD error during parallel charm builds. Reopened in 2025 as issue persists in modern Charmcraft despite prior closure.
qwen3.6-35b-a3b-mtp-q6
Staleness: 25
Complexity: 50
Confidence: 85
Support Request: 10
keep open Reopened bug reporting LXD socket activation errors during parallel charm builds. Recently confirmed active in modern Charmcraft CI, awaiting maintainer investigation.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-providers#899 (confidence 90%)

    PR #899 (commit e0f6bc7) added the snap watch retry, with a regression test reproducing this issue's exact stderr message.

  • Related To: charmcraft#1132 (confidence 65%)

    Same LXD parallel-build symptom class, already closed via concurrency controls on the Charmcraft side.

  • Duplicate Of: craft-providers#341 (confidence 55%)

    Maintainer sergiusens (2023-09-06) explicitly said "Duplicate of #341"; that parallel-instance race was separately fixed via project-existence recheck. The author retested and disagreed, and the snapshot error here is a distinct snapd issue, so the duplicate link is only partially accurate.

Related issues

Issue Project State Summary Similarity
#870 snapd "daemon is stopping to wait for socket activation" error during LXD container initialization craft-providers closed Fixed intermittent LXD initialization failures by retrying snap watch; merged in canonical/craft-providers#899 via commit e0f6bc7.
73%