Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details`
Metadata
Current evaluation
Closed as an environment conflict, not a Charmcraft defect: Docker had changed networking in a way that interfered with LXD, and the reporter confirmed that uninstalling Docker and restarting fixed it.
Resolution: closed not a bug
Reason: The reporter identified Docker's network configuration as the cause and confirmed that uninstalling Docker and rebooting restored `charmcraft pack`; no resolving Charmcraft change was needed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
The command worked as expected up to a few days ago. Downgrading to a lower version of both charmcraft and lxc/lxd didn't resolve the issue
### To Reproduce
Run `charmcraft pack` in root folder of any charm
### Environment
Ubuntu 22.04 LTS
Charmcraft 2.5.5
LXD 5.20
### charmcraft.yaml
```shell
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.
type: charm
bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"
```
### Relevant log output
```shell
charmcraft pack log:
2024-03-10 13:39:42.716 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.status
2024-03-10 13:39:42.822 Instance status: PREPARING
2024-03-10 13:39:42.822 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.timer
2024-03-10 13:39:42.927 Timer: 2024-03-10T12:38:34.770112+00:00
2024-03-10 13:39:45.930 Executing on host: lxc --project charmcraft info local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a
2024-03-10 13:39:46.044 Instance info: {'Name': 'base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a', 'Status': 'RUNNING', 'Type': 'container', 'Architecture': 'x86_64', 'PID': '431543', 'Created': '2024/03/10 13:37 WAT', 'Last Used': '2024/03/10 13:37 WAT', 'Resources': {'Processes': '5', 'CPU usage': {'CPU usage (in seconds)': '1'}, 'Memory usage': {'Memory (current)': '21.33MiB'}, 'Network usage': {'eth0': {'Type': 'broadcast', 'State': 'UP', 'Host interface': 'vethe538dd48', 'MAC address': '00:16:3e:80:e1:a6', 'MTU': '1500', 'Bytes received': '13.08kB', 'Bytes sent': '15.10kB', 'Packets received': '88', 'Packets sent': '186', 'IP addresses': {'inet': '10.105.61.128/24 (global)', 'inet6': 'fe80::216:3eff:fe80:e1a6/64 (link)'}}, 'lo': {'Type': 'loopback', 'State': 'UP', 'MTU': '65536', 'Bytes received': '0B', 'Bytes sent': '0B', 'Packets received': '0', 'Packets sent': '0', 'IP addresses': {'inet': '127.0.0.1/8 (local)', 'inet6': '::1/128 (local)'}}}}}
2024-03-10 13:39:46.044 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.status
2024-03-10 13:39:46.146 Instance status: PREPARING
2024-03-10 13:39:46.146 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.timer
2024-03-10 13:39:46.242 Timer: 2024-03-10T12:38:34.770112+00:00
2024-03-10 13:39:49.244 Executing on host: lxc --project charmcraft info local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a
2024-03-10 13:39:49.374 Instance info: {'Name': 'base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a', 'Status': 'RUNNING', 'Type': 'container', 'Architecture': 'x86_64', 'PID': '431543', 'Created': '2024/03/10 13:37 WAT', 'Last Used': '2024/03/10 13:37 WAT', 'Resources': {'Processes': '5', 'CPU usage': {'CPU usage (in seconds)': '1'}, 'Memory usage': {'Memory (current)': '21.33MiB'}, 'Network usage': {'eth0': {'Type': 'broadcast', 'State': 'UP', 'Host interface': 'vethe538dd48', 'MAC address': '00:16:3e:80:e1:a6', 'MTU': '1500', 'Bytes received': '13.08kB', 'Bytes sent': '15.10kB', 'Packets received': '88', 'Packets sent': '186', 'IP addresses': {'inet': '10.105.61.128/24 (global)', 'inet6': 'fe80::216:3eff:fe80:e1a6/64 (link)'}}, 'lo': {'Type': 'loopback', 'State': 'UP', 'MTU': '65536', 'Bytes received': '0B', 'Bytes sent': '0B', 'Packets received': '0', 'Packets sent': '0', 'IP addresses': {'inet': '127.0.0.1/8 (local)', 'inet6': '::1/128 (local)'}}}}}
2024-03-10 13:39:49.375 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.status
2024-03-10 13:39:49.492 Instance status: PREPARING
2024-03-10 13:39:49.493 Executing on host: lxc --project charmcraft config get local:base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a user.craft_providers.timer
2024-03-10 13:39:49.614 Timer: 2024-03-10T12:38:34.770112+00:00
2024-03-10 13:39:52.614 Instance setup failed. Check LXD logs for more details.
LXD logs:
time="2024-03-08T10:49:19+01:00" level=warning msg="Failed getting exec control websocket reader, killing command"
PID=188292 err="websocket: close 1006 (abnormal closure): unexpected EOF"
instance=base-instance-charmcraft-buildd-base-v50-97ec57918ad3a9bc094a interactive=false project=charmcraft
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict, not a Charmcraft defect: Docker had changed networking in a way that interfered with LXD, and the reporter confirmed that uninstalling Docker and restarting fixed it. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: Docker network settings interfered with LXD, and the reporter confirmed that uninstalling Docker and rebooting restored charmcraft pack. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an environment conflict: Docker altered networking and blocked LXD. The reporter resolved packing by uninstalling Docker and restarting; no Charmcraft fix was made. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed after the author confirmed uninstalling Docker resolved the conflict. Docker network settings interfered with LXD, causing charmcraft pack instance setup failures. Restarting the system after removal fixed the environment. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as resolved by the reporter. The LXD setup failure was caused by Docker's network settings conflicting with LXD. Uninstalling Docker and rebooting fixed the issue. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved via user workaround: Docker network settings interfered with LXD, causing charmcraft pack to fail. Uninstalling Docker and rebooting fixed the problem. The issue was closed without code changes. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed after the author resolved the LXD instance setup failure by uninstalling Docker. Docker's network changes conflicted with LXD, and removing it restored charmcraft pack functionality without code changes. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #660 `charmcraft pack` fails with error writing to lxd unix socket | charmcraft | closed | A transient LXD socket timeout stopped packing; `charmcraft clean` restored operation, the error did not recur, and the reporter closed the report without a code fix. | |
| #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. | |
| #511 `charmcraft pack` fails running `apt update` | charmcraft | closed | Closed with no Charmcraft code change: maintainers determined the `apt update` failure came from a broken host/LXD (fan bridge) networking setup, not a Charmcraft bug; guidance posted to Charmhub Discourse and the LXD forum. | |
| #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. | |
| #507 charmcraft pack fails for apt-utils is not available | charmcraft | closed | Closed as an environment conflict: Docker altered iptables and blocked LXD networking, preventing apt-utils installation. | |
| #647 `charmcraft build` sometimes fails on `apt install` inside the lxd container | charmcraft | closed | Closed as a duplicate of #567; its dpkg-lock fix merged via PR #745 (commit b1adccd5), adding provider warmup to avoid competing APT updates. | |
| #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. | |
| #1338 `charmcraft clean` doesn't clean | charmcraft | closed | Closed unresolved: LXD cleanup remained broken in Charmcraft 3, with the changed behavior attributed to craft-application#425, which also closed without a linked fix. | |
| #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. | |
| #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. |