← Back to issue list

Charmcraft stuck on "launching environment"

View original Github issue

Metadata

Project
charmcraft
Number
#1047
Type
issue
State
closed
Author
barrettj12
Labels
—
Created
Updated
Closed

Current evaluation

Craft-providers now verifies network connectivity and times out hung LXD setup, preventing indefinite waits; underlying LXD/Docker firewall conflicts may still require configuration.

Resolution: closed resolved

Reason: The maintainer closed the report on August 22, 2023, after craft-providers gained network-connectivity checks and setup timeouts. These changes resolved the indefinite-launch experience, although the underlying networking problem can recur.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When I run `charmcraft pack`, it gets stuck indefinitely on the step ``` Launching environment to pack for base name='ubuntu' channel='22.04' architectures=['amd64'] (may take a while the first time … | (431.7s) ``` Looking at the execution log, I see this line repeated hundreds/thousands of times: ``` 2023-03-15 16:20:01.901 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:02.483 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:03.043 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:03.785 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:04.237 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:04.741 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:05.237 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:05.717 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io 2023-03-15 16:20:06.293 Executing in container: lxc --project charmcraft exec local:charmcraft-juju-controller-7660250-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 getent hosts snapcraft.io ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Craft-providers now verifies network connectivity and times out hung LXD setup, preventing indefinite waits; underlying LXD/Docker firewall conflicts may still require configuration.
stealth/space-bunny-alpha — closed resolved craft-providers added network checks and timeouts for hung LXD setup, replacing Charmcraft's indefinite wait with an actionable failure. Maintainers closed the report after the fix shipped.
qwen3.6-35b-a3b-mtp-q6 — — Resolved by craft-providers 1.8, which now enforces timeouts and verifies network connectivity during LXD environment setup. This prevents indefinite hangs from networking or iptables conflicts, replacing silent failures with actionable error messages.
qwen/qwen3.6-35b-a3b — — Fixed in craft-providers 1.8, which now enforces timeouts and verifies network connectivity during container setup. Prevents indefinite hangs from incomplete LXD initialization or Docker iptables conflicts. Closed as improved error handling is now deployed.
qwen/qwen3.6-35b-a3b — — Resolved in craft-providers 1.8, which now enforces timeouts and verifies network connectivity during environment setup, preventing indefinite hangs. Users should still ensure Docker and LXD do not conflict with iptables rules.
qwen3.6-35b-a3b-mtp-q6 — — Closed. Craft-providers 1.8 now implements timeouts and verifies network connectivity during environment setup, resolving indefinite hangs caused by Docker iptables conflicts or incomplete LXD instance initialization.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: charmcraft#823 (confidence 100%)

    The reporter explicitly identified this report as a duplicate of #823.

  • Related To: charmcraft#1038 (confidence 100%)

    Proposed the craft-providers 1.8.1 update, but was auto-closed unmerged and was not the resolving change.

  • Related To: canonical/craft-providers#146 (confidence 95%)

    Maintainers linked this discussion about improving stuck environment detection.

Related issues

Issue Project State Summary Similarity
#823 more transparency for container build in first charmcraft pack charmcraft closed Firewall-blocked LXD setup hung `charmcraft pack` indefinitely on instance network setup. No charmcraft change needed; maintainer tracked the missing timeout in craft-providers and closed the issue.
75%
#1260 Charmcraft hangs or fails with LXD 5.18 charmcraft closed LXD released a fix for the 5.18 image lookup failure; Charmcraft’s separate edge retry hang was fixed by craft-providers#415 (commit da95d03).
74%
#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.
74%
#413 Charmcraft edge build hangs indefinitely when lxd image can't be found. craft-providers closed Missing-image LXD launch failures now fail fast with an error instead of polling a nonexistent instance forever, resolving the Charmcraft edge hang.
73%
#2093417 craft-providers error: Timed out waiting for networking to be ready. snapcraft (launchpad) open Snapcraft 8.5.1 with --use-lxd fails with 'craft-providers error: Timed out waiting for networking to be ready' during the getent hosts readiness check. Same report filed upstream as craft-providers#714; untriaged here, no maintainer response.
72%
#815 charmcraft pack fails - connection timed out could not connect charmcraft closed User-reported charmcraft pack failure was a local host/network problem (archive.ubuntu.com/security.ubuntu.com unreachable during apt cache update in the LXD build container). Author rebooted their machine and packing worked again, then self-closed the issue.
71%