Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details`
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as resolved. The author determined that Docker's network settings interfered with LXD. Uninstalling Docker and rebooting fixed the charmcraft pack instance setup failure. No upstream code fix was applied. |
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 | charmcraft pack failed due to an LXD socket I/O timeout. The author closed the issue as the error did not recur after a clean rebuild. No code changes were applied. | |
| #511 `charmcraft pack` fails running `apt update` | charmcraft | closed | Closed as out of scope. The failure stemmed from an LXD container networking bug, not charmcraft. No code changes were implemented; users were directed to external LXD and Discourse discussions for troubleshooting. | |
| #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. | |
| #507 charmcraft pack fails for apt-utils is not available | charmcraft | closed | Closed as an environment conflict. Docker interfered with iptables, blocking apt-utils in LXD. The author resolved it by uninstalling Docker, and a maintainer confirmed the networking issue with a workaround. No code changes were made. | |
| #497 charmcraft Pack is not Working | charmcraft | closed | Resolved via user environment fix. The permission error stemmed from running charmcraft as root with root-owned files. Switching to a regular user, adding them to the lxd group, and correcting ownership allowed pack to succeed. No code changes required. | |
| #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. | |
| #823 more transparency for container build in first charmcraft pack | charmcraft | closed | Closed as superseded. The charmcraft pack hang from firewall-blocked LXD traffic lacks a network timeout. A fix is tracked in craft-providers issue 146 and will be applied transparently to charmcraft. |