Charmcraft stuck on "launching environment"
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed via craft-providers v1.8, which now automatically times out and verifies network connectivity during setup. This upstream update prevents indefinite hangs, resolving the issue without manual cleanup. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1260 Charmcraft hangs or fails with LXD 5.18 | charmcraft | closed | Closed due to an upstream LXD bug. A fix was released for LXD 5.18 compatibility, resolving the hangs and failures. The investigation also uncovered a separate craft-providers issue tracked independently. | |
| #1640 Incompatibility with latest LXD LTS | charmcraft | closed | charmcraft failed parsing LXD 5.21 LTS version strings due to the appended LTS suffix. The issue was resolved by upgrading craft-providers to 1.23.1 and releasing the fix in charmcraft 2.6.0, now available on stable. | |
| #560 Charmcraft pack is giving error frequently | charmcraft | closed | Charmcraft pack failed due to an apt-get network error installing snapd in an LXD container. Maintainers linked it to a known networking issue. The reporter confirmed a workaround failed. Closed without a code fix, likely abandoned. |