snapcraft cleanbuild fails in xenial with the lxd deb: KeyError: 'kernel_architecture'
Metadata
Current evaluation
Fixed Xenial cleanbuild compatibility with older LXD metadata in snapcore/snapcraft PR #1305, merged as commit 8f15f697f.
Resolution: closed resolved
Reason: The issue's closing comment links PR #1305. Repository history identifies it as commit 8f15f697f, "lxd: support the architectures field from older LXDs," directly addressing the legacy LXD output.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I tried cleanbuild with snapcraft in a xenial machine with lxd installed from deb, version 2.0.9-0ubuntu1~16.04.2
In this lxc version, info returns kernelarchitecture instead of kernel_architecture:
$ lxc info | grep kernel
kernel: Linux
kernelarchitecture: x86_64
kernelversion: 4.4.0-71-generic
This merged but unreleased PR relies on kernel_architecture:
https://github.com/snapcore/snapcraft/pull/1286/files#diff-3f1bebf6d90bdd2cb2630b23737cd53aR58
Steps to reproduce:
In a xenial machine, install the lxd deb and run snapcraft cleanbuild from master.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed Xenial cleanbuild compatibility with older LXD metadata in snapcore/snapcraft PR #1305, merged as commit 8f15f697f. | |
| stealth/space-bunny-alpha | — | closed resolved | Xenial's LXD 2.0.9 deb reports `kernelarchitecture`, not `kernel_architecture`, breaking cleanbuild. Fixed by PR #1305 (commit 8f15f697f), which used LXD's existing `architectures` field for backward compatibility. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed Xenial LXD deb compatibility in snapcraft#1305 (commit 8f15f697f) by supporting both kernel_architecture and kernelarchitecture fields. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by merging a code update to handle both kernel_architecture and kernelarchitecture keys, resolving the Xenial LXD deb compatibility crash. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by addressing the kernel_architecture key dependency introduced in PR #1286, accommodating LXD's kernelarchitecture output. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the code to handle the kernelarchitecture key format returned by LXD on Xenial, resolving the KeyError during snapcraft cleanbuild. The referenced PR was merged and the issue closed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. Fixed by handling the LXD key naming mismatch that caused the cleanbuild KeyError, aligning with the referenced PR #1286. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1305
(confidence 99%)
Merged as commit 8f15f697f to support metadata returned by older LXD versions.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1666735 snapcraft cleanbuild does not work with lxd installed via snap | snapcraft (launchpad) | closed | Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata. | |
| #1703344 snapcraft cleanbuild exits with a traceback when lxd is not installed | snapcraft (launchpad) | closed | Fixed cleanbuild’s traceback when LXD is absent by handling the missing lxc executable and reporting a clear error. Merged in snapcraft#1400. | |
| #1822372 Snapcraft cleanbuild on Arch Linux with LXD - AppArmor permission error | snapcraft (launchpad) | closed | LP #1822372 closed as not-a-bug/stale: reporter resolved the AppArmor error with an LXD profile workaround (security.nesting/privileged, raw.lxc cgroup lines); maintainer later closed it noting cleanbuild was removed as builds are clean by default. | |
| #1788654 snapcraft cleanbuild doesn't work with cross-compile stage-packages | snapcraft (launchpad) | closed | Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded. | |
| #1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap | snapcraft (launchpad) | closed | Closed after the missing hostfs behavior was fixed upstream in lxc/lxd#4183. Snapcraft PR #1912 offered a workaround but was not merged. | |
| #1364 lxd: Inject snapcraft and core snaps into the container | snapcraft | merged | Merged PR #1364 as 99f5598ac, injecting the host's Snapcraft and core snaps into LXD containers so builds no longer use a mismatched Xenial archive version. | |
| #1577 lxd: don't inject local snaps on a different arch | snapcraft | merged | Merged in snapcraft#1577 via commit 5cef61310, preventing incompatible local snaps from being injected into cross-architecture LXD builds and using store snaps instead. | |
| #1641123 snapcraft does not properly detect the architecture when kernel is 64 bits but userspace is 32 | snapcraft (launchpad) | closed | Fixed in snapcore/snapcraft#1089 by deriving the build architecture from the compiler target, preventing 32-bit ARM artifacts from being mislabeled arm64. | |
| #1760857 SNAPCRAFT_IMAGE_INFO contains wrong architecture | snapcraft (launchpad) | closed | Wrong architecture in recorded LXD image info was fixed by merged snapcore/snapcraft PR #2046 (commit 828ea5120), which filtered image lookup by target architecture. | |
| #1737532 "snapcraft cleanbuild --target-arch=i386" produces amd64 executables | snapcraft (launchpad) | closed | Resolved with base-based builds; maintainer Sergiusens noted in 2021 that the legacy LXD cleanbuild architecture issue no longer applied. |