Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charmcraft snap fails to install due to a timeout on the configure hook #1987

Closed
PietroPasotti opened this issue Nov 13, 2024 · 7 comments
Closed
Labels
Bug Something isn't working

Comments

@PietroPasotti
Copy link

PietroPasotti commented Nov 13, 2024

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
24.04.1
LTS
Runner Image
Image: ubuntu-24.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

not applicable

Relevant log output

/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)
@PietroPasotti PietroPasotti added the Bug Something isn't working label Nov 13, 2024
@jnsgruk
Copy link
Member

jnsgruk commented Nov 13, 2024

This was fixed in #1984 and should be released soon :)

@PietroPasotti
Copy link
Author

not sure I see how it's related, but I hope you're right!

@jnsgruk
Copy link
Member

jnsgruk commented Nov 13, 2024

The workaround for now is to snap install lxd before you install charmcraft

@PietroPasotti
Copy link
Author

how does this explain the flaky behaviour? if it's missing lxd, how come it sometimes succeeds?

@PietroPasotti
Copy link
Author

also it seems that my GH workflow already had a

      - name: Setup LXD
        uses: canonical/setup-lxd@main

step right before the one that installs charmcraft. so either that step is b0rk or...?

@tigarmo
Copy link
Contributor

tigarmo commented Nov 13, 2024

@PietroPasotti according to the link you pasted (https://github.com/canonical/tempo-coordinator-k8s-operator/actions/runs/11814262043/job/32912967414?pr=62), the step that failed was "Check libs", which installs charmcraft but is separate from the job that sets up LXD (prepare-itest-runs)

@tigarmo
Copy link
Contributor

tigarmo commented Nov 13, 2024

how does this explain the flaky behaviour? if it's missing lxd, how come it sometimes succeeds?

If LXD is missing, calling lxc will install the snap from the store. This can then fail sometimes depending on transient store issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants