← Back to issue list

Incompatibility with latest LXD LTS

View original Github issue

Metadata

Project
charmcraft
Number
#1640
Type
issue
State
closed
Author
Batalex
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

No scores available.

Issue body

### Bug Description It seems like the lxd snap stable channel updated to a version not yet compatible with charmcraft. Unfortunately, it is not easy to roll back lxd to a previous version, because its internal database would break. ### To Reproduce - `lxd` and `charmcraft` snaps both tracking `latest/stable` - `charmcraft pack` ### Environment OS: Ubuntu 23.10 Snaps: ```shell sudo snap list | grep -E "lxd|charmcraft" charmcraft 2.5.5 2453 latest/stable canonical** classic lxd 5.21.1-43998c6 28155 latest/stable canonical** - ``` ### charmcraft.yaml ```shell # Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. type: charm parts: charm: charm-binary-python-packages: - setuptools build-packages: - pkg-config - libffi-dev - libssl-dev - rustc - cargo bases: - build-on: - name: "ubuntu" channel: "22.04" run-on: - name: "ubuntu" channel: "22.04" ``` ### Relevant log output ```shell cat /home/alex/.local/state/charmcraft/log/charmcraft-20240411-101147.334110.log 2024-04-11 10:11:47.335 Starting charmcraft version 2.5.5 2024-04-11 10:11:47.336 Reading '/home/alex/work/zookeeper-k8s-operator/metadata.yaml' 2024-04-11 10:11:47.338 Validating metadata keys 2024-04-11 10:11:47.339 Reading '/home/alex/work/zookeeper-k8s-operator/actions.yaml' 2024-04-11 10:11:47.340 Validating actions.yaml 2024-04-11 10:11:47.340 Reading '/home/alex/work/zookeeper-k8s-operator/config.yaml' 2024-04-11 10:11:47.341 Validating config.yaml 2024-04-11 10:11:47.342 System details: OSPlatform(system='ubuntu', release='23.10', machine='x86_64'); Environment: DESKTOP_SESSION='ubuntu', XDG_CURRENT_DESKTOP='ubuntu:GNOME' 2024-04-11 10:11:47.358 Packing the charm. 2024-04-11 10:11:47.456 charmcraft internal error: InvalidVersion("Invalid version: '5.21.1 LTS'") 2024-04-11 10:11:47.461 Traceback (most recent call last): 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/main.py", line 187, in main 2024-04-11 10:11:47.461 retcode = dispatcher.run() 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 484, in run 2024-04-11 10:11:47.461 return self._loaded_command.run(self._parsed_command_args) 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/commands/pack.py", line 153, in run 2024-04-11 10:11:47.461 self._pack_charm(parsed_args, builder) 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/commands/pack.py", line 204, in _pack_charm 2024-04-11 10:11:47.461 charms = builder.run( 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/instrum.py", line 152, in _f 2024-04-11 10:11:47.461 return func(*args, **kwargs) 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/package.py", line 282, in run 2024-04-11 10:11:47.461 charmcraft.providers.ensure_provider_is_available(self.provider) 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/charmcraft/providers.py", line 232, in ensure_provider_is_available 2024-04-11 10:11:47.461 provider.ensure_provider_is_available() 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/craft_providers/lxd/lxd_provider.py", line 80, in ensure_provider_is_available 2024-04-11 10:11:47.461 ensure_lxd_is_ready() 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/craft_providers/lxd/installer.py", line 127, in ensure_lxd_is_ready 2024-04-11 10:11:47.461 if not lxd.is_supported_version(): 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/craft_providers/lxd/lxd.py", line 85, in is_supported_version 2024-04-11 10:11:47.461 return packaging.version.parse(version) >= minimum_version 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/packaging/version.py", line 54, in parse 2024-04-11 10:11:47.461 return Version(version) 2024-04-11 10:11:47.461 File "/snap/charmcraft/2453/lib/python3.10/site-packages/packaging/version.py", line 200, in __init__ 2024-04-11 10:11:47.461 raise InvalidVersion(f"Invalid version: '{version}'") 2024-04-11 10:11:47.461 packaging.version.InvalidVersion: Invalid version: '5.21.1 LTS' 2024-04-11 10:11:47.461 Full execution log: '/home/alex/.local/state/charmcraft/log/charmcraft-20240411-101147.334110.log' ```

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 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.
qwen/qwen3.6-35b-a3b charmcraft failed to parse the LXD 5.21 LTS version string due to a craft-providers parsing bug. Fixed by updating craft-providers to 1.23.1 and releasing charmcraft 2.6.0, now available on the stable channel.
qwen/qwen3.6-35b-a3b charmcraft crashed parsing LXD 5.21 LTS versions. The issue was fixed by updating craft-providers to 1.23.1 and released as charmcraft 2.6.0 on the stable channel.
qwen3.6-35b-a3b-mtp-q6 Resolved by updating craft-providers to 1.23.1, which correctly parses the new LXD LTS version suffix. The fix was released in charmcraft 2.6.0 and deployed to the stable channel.
qwen3.6-35b-a3b-mtp-q6 charmcraft failed parsing the LXD 5.21 LTS version string. Resolved by updating craft-providers to 1.23.1 and releasing charmcraft 2.6.0 to stable.

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.
80%
#506 Build a charmed failed charmcraft closed charmcraft build failed due to an outdated LXD version lacking project support. Maintainers requested version details. Closed without resolution, likely abandoned, with a request to reopen if the problem persists.
74%
#1047 Charmcraft stuck on "launching environment" charmcraft closed 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.
74%
#685 charmcraft pack errors with LXDError - Name can only contain alphanumeric and hyphen characters charmcraft closed Resolved as an upstream LXD bug. The error originated from overly strict device name validation in certain LXD revisions. Fixed in LXD 4.23 revision 22525; users should update LXD to restore charmcraft pack functionality.
74%
#925 providers: set lxd project to 'charmcraft' charmcraft merged Merged a fix setting the LXD project to 'charmcraft' instead of 'default', resolving a regression from the craft-providers migration. Approved by one reviewer, the change updates two files with a +10/-4 diff.
73%