← Back to issue list

Snapcraft 9: snapcraftctl errors in core22 snaps

View original Github issue

Metadata

Project
snapcraft
Number
#6336
Type
issue
State
closed
Author
ThibF
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Fixed a validator bug preventing core22/core24 snaps without a `base` key from using `snapcraftctl`. Merged as #6499, resolving #6336.

Resolution: closed resolved

Reason: The issue was fixed by PR #6499 which corrected the build-base parsing logic for snapcraftctl validation in core22 snaps.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description While running a new build of a kernel snap for core 22, there was no significant changes on the snapcraft.yaml but it leaded to a build failure. The only major difference was the jump from snapcraft 8.14.5 to 9.0.1. The build-base is core 22. ### Steps to reproduce Prepare a snapcraft core 22. Use `snapcraftctl build` in an `override-build` stage. Trigger a build on launchpad. ### Environment This error popped up in launchpad snap building service ### snapcraft.yaml ```yaml name: XXXX-a-m1-kernel adopt-info: kernel summary: Ubuntu XXXX Linux Kernel description: The XXXX Ubuntu kernel package as a snap for XXXX project type: kernel confinement: strict build-base: core22 environment: LD_LIBRARY_PATH: ${SNAP}/usr/lib hooks: fde-setup: plugs: - tee - home parts: kernel: plugin: nil build-packages: - kmod stage-packages: - linux-image-uc22-XXXX - linux-image-XXXX - linux-XXXX-firmware organize: boot: ./ lib/firmware: firmware lib/modules: modules usr/share/doc: doc override-build: | craftctl set version="$(apt show linux-image-uc22-XXXX 2>/dev/null | sed -n 's/^Version: //p' | head -n1)" rm -f "$SNAPCRAFT_PART_INSTALL"/boot/vmlinuz-* "$SNAPCRAFT_PART_INSTALL"/boot/fit-*-nofde mv "$SNAPCRAFT_PART_INSTALL"/boot/fit-*-fde "$SNAPCRAFT_PART_INSTALL"/boot/kernel.img depmod -b "$SNAPCRAFT_PART_INSTALL" $(basename "$SNAPCRAFT_PART_INSTALL"/lib/modules/*) ls . ls / if [ -e /usr/lib/ubuntu-core-initramfs/main/usr/lib/snapd/info ]; then cp /usr/lib/ubuntu-core-initramfs/main/usr/lib/snapd/info "$SNAPCRAFT_PART_INSTALL"/snapd-info; elif [ -e /usr/lib/snapd/info ]; then cp /usr/lib/snapd/info "$SNAPCRAFT_PART_INSTALL"/snapd-info; elif [ -e chroot/usr/lib/snapd/info ]; then cp chroot/usr/lib/snapd/info "$SNAPCRAFT_PART_INSTALL"/snapd-info; else echo "ERROR: no snapd-info found" 1>&2; exit 1; fi craftctl default stage: - -doc/crda - -doc/linux-base - -doc/iw - -etc - -firmware/amd - -firmware/amdgpu - -firmware/asihpi - -firmware/cavium - -firmware/cxgb3 - -firmware/cxgb4 - -firmware/dpaa2 - -firmware/i915 - -firmware/intel - -firmware/iwlwifi-* - -firmware/liquidio - -firmware/matrox - -firmware/mellanox - -firmware/mrvl - -firmware/moxa - -firmware/netronome - -firmware/nvidia - -firmware/qed - -firmware/radeon - -firmware/rockchip - -firmware/ath10k/QCA9377/hw1.0/firmware-5.bin - -firmware/ath3k-1.fw - -firmware/qca/htbtfw20.tlv - -firmware/qcom - -firmware/s5p* - -lib - -sbin - -usr fdehook: plugin: nil build-packages: - oem-fdehelper-optee override-build: | mkdir -p "$SNAPCRAFT_PART_INSTALL"/meta/hooks "$SNAPCRAFT_PART_INSTALL"/usr/lib cp -a /usr/bin/fde-setup "$SNAPCRAFT_PART_INSTALL"/meta/hooks cp -a /usr/lib/libteec* "$SNAPCRAFT_PART_INSTALL"/usr/lib ``` ### Log output ```shell snapcraft 9.0.1 from Canonical** installed Running repo phase... Cloning into 'XXXXX-kernel'... [12/Jul/2026:22:36:16 +0000] "CONNECT git.launchpad.net:443 HTTP/1.1" 200 4520178 "-" "git/2.34.1" Running pull phase... Traceback (most recent call last): File "/snap/snapcraft/18519/bin/snapcraft", line 12, in <module> sys.exit(main()) ^^^^^^ File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/application.py", line 358, in main return cli.run() ^^^^^^^^^ File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/cli.py", line 258, in run _run_dispatcher(dispatcher, global_args) File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/cli.py", line 231, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/18519/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 576, in run return self._loaded_command.run(self._parsed_command_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/commands/core22/lifecycle.py", line 118, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/parts/lifecycle.py", line 99, in run project = models.Project.unmarshal(yaml_data_for_arch) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/snap/snapcraft/18519/lib/python3.12/site-packages/snapcraft/models/project.py", line 2120, in unmarshal return pydantic.TypeAdapter(SnapcraftProject).validate_python(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/snap/snapcraft/18519/lib/python3.12/site-packages/pydantic/type_adapter.py", line 441, in validate_python return self.validator.validate_python( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for function-before[_validate_type(), tagged-union[tagged-union[function-after[_validate_platforms_and_architectures(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), Core22Project]]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), Core24Project]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), Core26Project]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), DevelBaseProject]]],tagged-union[function-after[_validate_platforms_and_architectures(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), BareCore22Project]]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), BareCore24Project]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), BareCore26Project]]],function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), BareDevelProject]]]]],tagged-union[function-after[_validate_platforms_and_architectures(), function-after[_validate_no_base(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), _BaselessCore22Project]]]]],function-after[_validate_no_base(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), _BaselessProject]]]],function-after[_validate_no_base(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), _BaselessProject]]]],function-after[_validate_no_base(), function-after[_validate_grade_and_build_base(), function-after[_validate_adoptable_fields(), function-after[_validate_bare_base_requires_build_base(), _BaselessProject]]]]]]] baseless.core22.parts Value error, Can't use 'snapcraftctl' in the override-build script for part 'kernel'. Use 'craftctl' instead. [type=value_error, input_value={'kernel': {'plugin': 'ni...RT_INSTALL"/usr/lib\n'}}, input_type=dict] For further information visit https://errors.pydantic.dev/2.12/v/value_error Build failed Traceback (most recent call last): File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 341, in run self.pull() File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 264, in pull self.run_build_command( File "/usr/lib/python3/dist-packages/lpbuildd/target/operation.py", line 70, in run_build_command return self.backend.run(args, cwd=cwd, env=full_env, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/lpbuildd/target/lxd.py", line 736, in run subprocess.check_call(cmd, **kwargs) File "/usr/lib/python3.12/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['lxc', 'exec', 'lp-jammy-arm64', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'HTTP_PROXY=http://10.10.10.1:8222/', '--env', 'HTTPS_PROXY=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/lpbuildd-git-proxy', '--env', 'SNAPPY_STORE_NO_CDN=1', '--env', 'LAUNCHPAD_INSTANCE=production', '--env', 'LAUNCHPAD_SERVER_URL=launchpad.net', '--env', 'SNAPCRAFT_LOCAL_SOURCES=1', '--env', 'SNAPCRAFT_SETUP_CORE=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-115638100", "build-request-timestamp": "2026-07-10T13:33:56Z", "build_url": "https://launchpad.net/~XXXXX-team/XXXXXX/+snap/XXXXXX-01/+build/3212660"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--', '/bin/sh', '-c', 'cd /build/XXXXX-kernel && linux64 snapcraft pull']' returned non-zero exit status 1. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b — closed resolved Fixed a validator bug preventing core22/core24 snaps without a `base` key from using `snapcraftctl`. Merged as #6499, resolving #6336.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 45
Complexity: 16
Confidence: 96
Actionability: 92
keep open Snapcraft 9.0.1 rejects snapcraftctl in core22 baseless/kernel builds. A maintainer confirmed the regression with a minimal reproducer; the issue is triaged and remains open without a recorded fix.
stealth/space-bunny-alpha
Impact: 68
Quick Win: 39
Complexity: 40
Confidence: 96
Actionability: 95
keep open Snapcraft 9.0.1 regressed core22 compatibility by rejecting snapcraftctl in override-build scripts; maintainer reproduced the failure and tracking ticket SNAPCRAFT-1371 exists.
qwen3.6-35b-a3b-mtp-q6
Impact: 75
Quick Win: 68
Staleness: 45
Complexity: 10
Confidence: 85
Support Request: 0
keep open Regression in snapcraft 9: core22 snaps using snapcraftctl in override-build fail validation. Maintainer confirmed as a regression.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 50
Confidence: 95
Support Request: 0
keep open Regression in Snapcraft 9 causing build failures for core22 snaps using snapcraftctl. Maintainer confirmed as a regression.
qwen3.6-35b-a3b-mtp-q6
Staleness: 0
Complexity: 10
Confidence: 80
Support Request: 80
needs triage Build failure on core22 snap after upgrading to snapcraft 9.0.1. Error explicitly rejects 'snapcraftctl' in favor of 'craftctl'. Issue is fresh, unlabelled, and requires maintainer confirmation of expected behavior.

Update history

Date Change
closed

Related work

  • Likely Fixed By: snapcraft#6499 (confidence 100%)

    PR #6499 explicitly resolves the snapcraftctl validation error for core22 snaps reported in #6336.

Related issues

Issue Project State Summary Similarity
#6499 fix: parse build-base for snapcraftctl validation snapcraft merged Fixed a validator bug preventing core22/core24 snaps without a `base` key from using `snapcraftctl`. Merged as #6499, resolving #6336.
88%
#5983 feat!: error on snapcraftctl snapcraft merged Merged #5983 as eaadefa01: snapcraftctl now errors in core26+ override scripts, and related references were renamed to craftctl.
76%
#4186 snap: migrate to core22 snapcraft merged PR #4186 merged, moving the Snapcraft snap's own build environment to base core22 (8 files, +71/-70), landing as commit 60033305b and closing the core22 migration issue #4166.
75%
#6450 fix(test): error for core22 snaps snapcraft closed PR #6450 proposed an early core22 error for snapcraft test, but was closed unmerged with review pending; #5479 remains open.
74%
#4118 init: use core22 base for `snapcraft init` snapcraft merged Merged PR #4118 (mr-cal, CRAFT-1670): snapcraft init now scaffolds core22 as the default base instead of core20, with the command moved from snapcraft_legacy/ to snapcraft/ and a spread test added. Squash-merged as 4afc9e4c9.
74%
#5774 Remove all snapcraftctl code and compatibility wrapper for core22 snapcraft closed PR to strip snapcraftctl code for core22 was closed unmerged: maintainers (mr-cal) said removal can't happen for core22/core24 as it would break existing builds, so the wrapper was kept. Later #5983 (eaadefa01) errors on snapcraftctl only in core26.
74%
#4166 Migrate Snapcraft to core22 snapcraft closed Snapcraft's own snap was migrated to base core22 by merged PR #4186 (commit 60033305b, 8 files, +71/-70), closing this tracking issue.
74%
#3751 craftctl: add snapcraftctl compatibility wrapper snapcraft merged Merged #3751 added a snapcraftctl compatibility wrapper delegating to craftctl, prompted core22 users to migrate, and restored execution of existing spread tests.
73%
#33 Snapcraft-rocks fails when executing craftctl snapcraft-rocks closed craftctl failures were fixed by merged PRs #45 (core22-7), #67 (core24-8), and #84 (core22-8); merged PR #102 added regression coverage.
72%
#1976221 Missing linker base while building with core22 base snapcraft (launchpad) closed Resolved by upgrading from legacy Snapcraft to Snapcraft 7.x, which correctly builds core22 snaps; no code fix or linked PR was recorded.
72%