← Back to issue list

Suddenly getting charmcraft internal error with charmcraft pack

View original Github issue

Metadata

Project
craft-providers
Number
#92
Type
issue
State
closed
Author
PietroPasotti
Labels
—
Created
Updated
Closed

Current evaluation

Resolved upstream in LXD 4.23 revision 22525+, which corrected overly strict device-name validation; `snap revert lxd` was a temporary workaround.

Resolution: closed not a bug

Reason: The failure was an LXD validation regression, not a craft-providers defect. A maintainer confirmed it was fixed in LXD 4.23 revision 22525 or newer and would update automatically.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Since today, I am unable to `charmcraft pack` anything. What changed since yesterday? Did an `apt upgrade` which bumped `snapd` among other unrelated things and did some old kernel images cleanup (my /boot partition was full). Not sure if that's related, but... ``` lxd: 4.23 charmcraft: 1.4.0 $ snap version snap 2.54.3+20.04.1ubuntu0.1 snapd 2.54.3+20.04.1ubuntu0.1 series 16 ubuntu 20.04 kernel 5.13.0-28-generic ``` Posting this here because the culprit seems to be `craft_providers/lxd/lxc.py", line 121, in config_device_add_disk` maybe something changed in lxc to the effect that disk-/anything/with/slashes is no longer a valid device name? [charmcraft-20220223-111023.300160.log](https://github.com/canonical/craft-providers/files/8123542/charmcraft-20220223-111023.300160.log) apparently an update to the lxd snap changed the validation logic for device names; that update occurred overnight for me. Related: https://github.com/lxc/lxd/pull/9960/files `snap revert lxd` fixed this issue.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Resolved upstream in LXD 4.23 revision 22525+, which corrected overly strict device-name validation; `snap revert lxd` was a temporary workaround.
qwen/qwen3.6-35b-a3b — closed resolved LXD snap update introduced overly strict device name validation, causing charmcraft pack to fail. Resolved in LXD 4.23 revision 22525 or higher.

Update history

Date Change
created

Related work

  • Related To: lxd#9960 (confidence 95%)

    Upstream LXD validation change associated with the device-name regression.

Related issues

Issue Project State Summary Similarity
#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.
79%
#685 charmcraft pack errors with LXDError - Name can only contain alphanumeric and hyphen characters charmcraft closed Packing failures came from an upstream LXD 4.23 device-name validation regression, fixed in revision 22525 or later; no Charmcraft code change was needed.
78%
#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.
78%
#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.
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%
#2816 `charmcraft pack` fails on Resolute charmcraft open charmcraft pack fails on Ubuntu Resolute 26.04 hosts when using a Jammy 20.04 build base: snapd inside the LXD build instance cannot reload snap-confine AppArmor profiles; no maintainer response yet.
73%
#1594 Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details` charmcraft closed 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.
73%
#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.
72%
#1054 Charmcraft fails to launch LXD instance with high uid (`raw.idmap=both 595156457 0`) charmcraft open High host UID causes LXD launch failure via raw.idmap=both; diagnosed as craft-providers idmap issue, fixed upstream by separate uid/gid maps and charmcraft now depends on fixed version.
72%
#676 charmcraft build fails with LXD version charmcraft closed User support request: charmcraft build/pack failed with "LXD '3.0.3' does not meet the minimum required version '4.0'". facundobatista confirmed LXD 4.0+ is required by design and suggested --destructive-mode; no code change.
72%