← Back to issue list

Snapcraft 7 fails with inline deb822 signing blocks

View original Github issue

Metadata

Project
snapcraft
Number
#4408
Type
issue
State
open
Author
lengau
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Snapcraft 7 core20 LXD builds fail on hosts with modern apt deb822 Signed-By blocks due to a legacy apt package check in snapcraft_legacy. Triaged; root cause identified, but snapcraft_legacy and core20 have since been removed from the codebase.

Suggested action: close stale

Reason: The issue was triaged and maintainer mr-cal identified the root cause as a legacy apt check in snapcraft_legacy/internal/build_providers/_lxd/_lxd.py#L90. However, snapcraft_legacy has since been removed (commit ffb164b7a 'chore: remove snapcraft_legacy') and core20 support dropped (commit fa7952b4d 'chore!: drop core20 (#6019)'), so the problematic code path no longer exists and the bug is no longer reproducible in the current codebase.

Impact: 35 Quick Win: 26.25 Staleness: 85 Complexity: 25 Confidence: 85 Support Request: 10

Issue body

### Bug Description Modern apt (unsure since when) supports inline `Signed-By`, which is the default way to add PPAs in mantic. However, when using LXD (at least for a core20 charm), this breaks snapcraft. WORKAROUND: use the (default) multipass backend. ### To Reproduce 1. Put the following file in `/etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-mantic.sources` ``` Types: deb URIs: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ Suites: jammy Components: main Signed-By: -----BEGIN PGP PUBLIC KEY BLOCK----- . mQINBFl8fYEBEADQmGZ6pDrwY9iH9DVlwNwTOvOZ7q7lHXPl/TLfMs1tckMc/D9a hsdBN9VWtMmo+RySvhkIe8X15r65TFs2HE8ft6j2e/4K472pObM1hB+ajiU/wYX2 Syq7DBlNm6YMP5/SyQzRxqis4Ja1uUjW4Q5/Csdf5In8uMzXj5D1P7qOiP2aNa0E r3w6PXWRTuTihWZOsHv8npyVYDBRR6gEZbd3r86snI/7o8Bfmad3KjbxL7aOdNMw AqQFaNKl7Y+UJpv1CNFIf+twcOoC0se1SrsVJlAH9HNHM7XGQsPUwpNvQlcmvr+t 1vVS2m72lk3gyShDuJpi1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ugoKkNp8ZXcGJ8BGw37Wep2ztyzDohXp6f/4mGgy2KYV9R4S8D5 yBDUU6BS7Su5nhQMStfdfr4FffLmnvFC9w== =7hFk -----END PGP PUBLIC KEY BLOCK----- ``` 2. Get a core20 snap (e.g. `git clone git@github.com:canonical/charmcraft.git`) 3. `snapcraft --use-lxd` ### Environment Kubuntu Mantic plus the sources file above (yes I know I shouldn't be pointing to a jammy source...) ### snapcraft.yaml ```shell N/A ``` ### Relevant log output ```shell $ snapcraft --verbose --use-lxd Starting Snapcraft 7.5.3 Logging execution to '/home/lengau/.local/state/snapcraft/log/snapcraft-20231018-125641.121134.log' Sorry, an error occurred in Snapcraft: E:Invalid value set for option Signed-By regarding source https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ jammy (not a fingerprint), E:The list of sources could not be read. We would appreciate it if you anonymously reported this issue. No other data than the traceback and the version of snapcraft in use will be sent. Would you like to send this error data? (Yes/No/Always/View) [no]: n You can find the traceback in file '/tmp/tmp3m36qgt8/trace.txt'. trace: Traceback (most recent call last): File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/cli.py", line 255, in run _run_dispatcher(dispatcher, global_args) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/cli.py", line 228, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/9726/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 448, in run return self._loaded_command.run(self._parsed_command_args) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 265, in run super().run(parsed_args) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 138, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 179, in run yaml_data = process_yaml(snap_project.project_file) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 142, in process_yaml yaml_data = yaml_utils.load(yaml_file) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft/parts/yaml_utils.py", line 94, in load raise errors.LegacyFallback(f"base is {build_base}") snapcraft.errors.LegacyFallback: base is core20 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/cli/legacy.py", line 27, in legacy_run run() File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/cli/_runner.py", line 139, in run snap_command.invoke(ctx) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/9726/lib/python3.8/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/cli/lifecycle.py", line 405, in snap _execute(steps.PRIME, parts=tuple(), pack_project=True, output=output, **kwargs) File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/cli/lifecycle.py", line 141, in _execute build_provider_class.ensure_provider() File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/internal/build_providers/_lxd/_lxd.py", line 90, in ensure_provider if repo.Repo.is_package_installed("lxd") or repo.Repo.is_package_installed( File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/_deb.py", line 535, in is_package_installed with AptCache() as apt_cache: File "/snap/snapcraft/9726/lib/python3.8/site-packages/snapcraft_legacy/internal/repo/apt_cache.py", line 58, in __enter__ self.cache = apt.Cache() File "/snap/snapcraft/9726/lib/python3.8/site-packages/apt/cache.py", line 170, in __init__ self.open(progress) File "/snap/snapcraft/9726/lib/python3.8/site-packages/apt/cache.py", line 232, in open self._cache = apt_pkg.Cache(progress) apt_pkg.Error: E:Invalid value set for option Signed-By regarding source https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ jammy (not a fingerprint), E:The list of sources could not be read. ``` ### Additional context This will probably be fixed with the core22 move, but it's strange that snapcraft would be checking the repositories on the host at all (unless in destructive mode).

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 26.25
Staleness: 85
Complexity: 25
Confidence: 85
Support Request: 10
close stale Snapcraft 7 core20 LXD builds fail on hosts with modern apt deb822 Signed-By blocks due to a legacy apt package check in snapcraft_legacy. Triaged; root cause identified, but snapcraft_legacy and core20 have since been removed from the codebase.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 20
Confidence: 85
Support Request: 5
keep open Snapcraft 7 fails when using LXD with modern apt's inline deb822 Signed-By blocks due to legacy host apt source parsing. Triaged and under maintainer analysis with a proposed fix.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 15
Confidence: 90
Support Request: 0
keep open Snapcraft 7 fails with LXD backend when modern apt uses inline deb822 Signed-By blocks. Triaged bug with maintainer-identified root cause in legacy code; awaiting fix.
qwen3.6-35b-a3b-mtp-q6
Staleness: 15
Complexity: 25
Confidence: 95
Support Request: 0
keep open Snapcraft 7 fails with LXD when using modern apt's inline deb822 Signed-By format. Root cause is legacy package-checking code that can be removed. Triaged and awaiting a fix, similar to issue #4960.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#4960 (confidence 80%)

    Maintainer mr-cal noted on 2025-04-28: 'This is very similar to #4960. Same function, but fails on the snap code instead of the apt code.' Both stem from the same legacy LXD provider package-check logic.

Related issues

Issue Project State Summary Similarity
#1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap snapcraft (launchpad) closed Closed without resolution. Snapcraft hardcodes the LXD snap path during cleanbuild, causing failures with deb-installed LXD. The report appears abandoned or superseded by updated Snapcraft versions that dynamically detect LXD installations.
73%
#4960 Can't build Core20 snaps on non-snap distros snapcraft open Core20 snap builds fail on non-snap distros (NixOS) due to LXD snap detection. Triaged with a proposed backport fix, but core20 support and snapcraft_legacy have since been removed from the project, making the issue no longer applicable.
73%
#1750642 Snapcraft fails in LXD container on Debian 9 snapcraft (launchpad) closed Closed as stale. The Snapcraft LXD container build failure on Debian 9 was not resolved due to outdated Debian and Snapcraft versions no longer being supported.
73%
#5420 Snapcraft 7 fails to launch a LXD container based on host apt sources entries snapcraft closed Closed as a duplicate of #4408. Snapcraft 7 fails to parse PGP fingerprints in host apt sources when launching LXD containers, triggering an apt_pkg.Error. Resolution is tracked in the referenced duplicate.
72%
#1981979 snapcraft 7.0.8+ stopped working on non debian systems snapcraft (launchpad) closed Closed without resolution or comments. The reported apt_pkg error blocking snapcraft 7.0.8+ builds on non-Debian systems remains unfixed and the issue appears abandoned.
72%
#4285 Snapcraft v7 fails to build core18 snap with local plugins snapcraft closed Snapcraft v7 failed to build core18 snaps with local plugins due to an unredirected snapcraft.sources import. Snapcraft v7.5.3 resolved this by implementing the required legacy import redirection, enabling successful builds.
72%
#2099923 Snapcraft builds are failing: install of snap "snapcraft" failed snapcraft (launchpad) open Snapcraft builds failing due to outdated snapd (2.61) on build infrastructure unable to install core20 base. Issue is 556 days old with no maintainer response.
72%
#1583236 snapcraft APT sources checking too strict snapcraft (launchpad) open snapcraft fails builds when APT exits nonzero for non-critical warnings (e.g., outdated hash functions, unsupported PPAs). Unlabelled, zero comments, no maintainer interaction; references obsolete 2015-era sources.
71%
#1866300 snapcraft fails to build core20 snap snapcraft (launchpad) closed Closed without comments or resolution after 74 days. The core20 build failure involving multipass hangs and LXD tracebacks was abandoned.
71%