Charmcraft snap fails to install due to a timeout on the configure hook
Metadata
Current evaluation
Resolved by merged PR #1984 (commit 02539ab0), which checks that LXD is installed before snap hooks call lxc, avoiding implicit LXD installation and configure-hook timeouts.
Resolution: closed resolved
Reason: PR #1984 was merged and added an early LXD installation check to the configure and remove hooks. The maintainer explicitly confirmed that this fix resolved the reported timeout.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Recently I've seen a flaky error appear on `snap install charmcraft`.
It seems that the `configure` step times out. It only occurs in CI so far, so it's probably due to resource constraints.
Example failure in CI:
https://github.com/canonical/tempo-coordinator-k8s-operator/actions/runs/11814262043/job/32912967414?pr=62
Sometimes to make it go away it's enough to retry (a couple of times...).
### To Reproduce
`snap install charmcraft --classic --channel 3.x/candidate`
### Environment
Current runner version: '2.320.0'
Operating System
Ubuntu
[2](https://github.com/canonical/tempo-coordinator-k8s-operator/actions/runs/11814262043/job/32912967414?pr=62#step:1:2)4.04.1
LTS
Runner Image
Image: ubuntu-2[4](https://github.com/canonical/tempo-coordinator-k8s-operator/actions/runs/11814262043/job/32912967414?pr=62#step:1:4).04
Version: 20241112.1.0
Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20241112.1/images/ubuntu/Ubuntu2404-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20241112.1
### charmcraft.yaml
```yaml
not applicable
```
### Relevant log output
```shell
/usr/bin/sudo snap install charmcraft --classic --channel 3.x/candidate
error: cannot perform the following tasks:
- Run configure hook of "charmcraft" snap if present (run hook "configure": <exceeded maximum runtime of 5m0s>)
Error: The process '/usr/bin/sudo' failed with exit code 1
Error: Error: The process '/usr/bin/sudo' failed with exit code 1
at ExecState._setResult (/home/runner/work/_actions/canonical/charming-actions/934193396735701141a1decc3613818e412da606/dist/check-libraries/index.js:3950:25)
at ExecState.CheckComplete (/home/runner/work/_actions/canonical/charming-actions/934193396735701141a1decc3613818e412da606/dist/check-libraries/index.js:3933:18)
at ChildProcess.<anonymous> (/home/runner/work/_actions/canonical/charming-actions/934193396735701141a1decc3613818e412da606/dist/check-libraries/index.js:3827:27)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved by merged PR #1984 (commit 02539ab0), which checks that LXD is installed before snap hooks call lxc, avoiding implicit LXD installation and configure-hook timeouts. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #1984 (commit 02539ab0), adding an LXD installation check to configure/remove hooks to prevent the snap install timeout. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in PR #1984 and released. The charmcraft snap configure hook timeout was resolved. Flaky failures occurred when LXD was absent, triggering a transient store download. The issue is closed. | |
| qwen/qwen3.6-35b-a3b | — | — | The charmcraft snap configure hook timeout in CI was fixed in pull request #1984. While a workaround suggested installing LXD beforehand, the underlying issue was resolved and scheduled for release. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in PR #1984. The charmcraft snap configure hook timeout during CI installation was resolved. A temporary workaround suggested pre-installing LXD, but the underlying issue was permanently addressed in the merged pull request. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in PR #1984. The charmcraft snap configure hook timeout during CI installation was resolved. Pre-installing LXD served as a temporary workaround before the fix was merged and released. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#1984
(confidence 100%)
Merged fix commit 02539ab0 prevents hooks from invoking lxc when LXD is absent.
-
Duplicate Of:
canonical/charmcraft#1982
(confidence 96%)
Reported the same configure-hook timeout and is documented as fixed by PR #1984.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1984 fix(snap): check if LXD is actually installed | charmcraft | merged | Merged PR canonical/charmcraft#1984 (commit 02539ab0) adds early LXD detection to the snap configure/remove hooks so they bail out instead of triggering the lxd-installer snap; fixes #1982. | |
| #646 Failed to inject host Charmcraft snap into target environment | charmcraft | closed | Report of charmcraft 1.4.0 failing to inject the host snap into the LXD build env. Closed without a code fix: a user fixed it with `charmcraft clean --verbose` and lengau closed it in Jan 2024 as not reproducible on current versions. | |
| #560 Charmcraft pack is giving error frequently | charmcraft | closed | The failure was traced to external LXD networking blocking access to archive.ubuntu.com during snapd installation; no Charmcraft fix was merged, and the reported firewall workaround did not help. | |
| #1202 `charmcraft` installs newer version in LXC container & doesn't respect pinned snap revision | charmcraft | closed | Automatic LXC snap refreshes were fixed in PR #1219 by upgrading craft-providers and adding a regression test verifying that refreshes remain held forever. | |
| #1982 Snap configure hook timing out in CI | charmcraft | closed | Configure-hook CI timeouts were fixed by merged PR #1984 (commit 02539ab0), preventing hooks from triggering the slow implicit installation of LXD. | |
| #92 Suddenly getting charmcraft internal error with charmcraft pack | craft-providers | closed | Resolved upstream in LXD 4.23 revision 22525+, which corrected overly strict device-name validation; `snap revert lxd` was a temporary workaround. |