← 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

Fixed in Charmcraft 2.6.0 by merged PR #1641 (commit 2248543f), shipping the craft-providers 1.23.1 fix for LXD versions with the LTS suffix; released to stable.

Resolution: closed resolved

Reason: Maintainers linked the resolution to merged PR #1641 (commit 2248543f) and confirmed Charmcraft 2.6.0 was available on stable by 2024-04-12. The release incorporated the existing craft-providers 1.23.1 fix for LXD's LTS version suffix.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Fixed in Charmcraft 2.6.0 by merged PR #1641 (commit 2248543f), shipping the craft-providers 1.23.1 fix for LXD versions with the LTS suffix; released to stable.
stealth/space-bunny-alpha — closed resolved Fixed LXD 5.21 LTS version parsing via the craft-providers 1.23.1 dependency update in PR #1641 (2248543f). Charmcraft 2.6.0 shipped the fix to stable.
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.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#925 providers: set lxd project to 'charmcraft' charmcraft merged Merged PR #925 in d82b9bb8, fixing the LXD provider regression by using the charmcraft project instead of default.
79%
#554 Issues with concurrent builds charmcraft closed Concurrent LXD setup races were fixed by Craft Providers #158 (commit 3069492), and the maintainer confirmed the fix was included in Charmcraft.
76%
#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).
76%
#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.
73%
#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.
71%
#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.
71%
#1132 LXD race condition when packing multiple charms simultaneously charmcraft closed The concurrent LXD project-creation race was fixed in Charmcraft edge and 2.4.0; a follow-up instance-copy race was addressed by craft-providers PR #357.
71%
#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.
70%
#1202 `charmcraft` installs newer version in LXC container & doesn't respect pinned snap revision charmcraft closed Automatic LXC snap refreshes were fixed in PR #1219 by upgrading craft-providers and adding a regression test verifying that refreshes remain held forever.
70%
#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.
70%