Regression: snapcraft started failing with craft_archives.repo.errors.AptGPGKeyInstallError
Metadata
Current evaluation
A snapcraft regression causing AptGPGKeyInstallError from multi-key files was fixed. Resolution updated key parsing logic, with a hotfix released in version 7.4.4 and merged via PR #4241. The issue is closed.
Suggested action: —
No scores available.
Issue body
### Bug Description
On Friday git-ubuntu CI regressed. It uses the stable snapcraft snap.
It seems that something was switched that caused it to start failing with an error from inside craft-archives. See https://github.com/canonical/craft-archives/issues/83 for details.
### To Reproduce
In a Focal lxd container, running as the ubuntu user (eg. `lxc launch ubuntu:focal test-container && lxc shell test-container` and then `login -f ubuntu`):
```
git clone https://git.launchpad.net/git-ubuntu
git checkout 8f0d8e5
sh snap.sh
```
### Environment
Snapcraft is in destructive mode inside a lxd container.
### snapcraft.yaml
```shell
See https://git.launchpad.net/git-ubuntu/tree/snap/snapcraft.yaml although note that snap.sh modifies it slightly to work around LP: #1918968. See that script for details.
```
### Relevant log output
```shell
File "/snap/snapcraft/9362/lib/python3.8/site-packages/snapcraft_legacy/internal/project_loader/_config.py", line 304, in get_build_packages
self.install_package_repositories()
File "/snap/snapcraft/9362/lib/python3.8/site-packages/snapcraft_legacy/internal/project_loader/_config.py", line 288, in install_package_repositories
refresh_required |= key_manager.install_package_repository_key(
File "/snap/snapcraft/9362/lib/python3.8/site-packages/craft_archives/repo/apt_key_manager.py", line 257, in install_package_repository_key
self.install_key(key=key_path.read_text())
File "/snap/snapcraft/9362/lib/python3.8/site-packages/craft_archives/repo/apt_key_manager.py", line 170, in install_key
raise errors.AptGPGKeyInstallError(
craft_archives.repo.errors.AptGPGKeyInstallError: Failed to install GPG key: Key must be a single key, not multiple.
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | A snapcraft regression causing AptGPGKeyInstallError from multi-key files was fixed. Resolution updated key parsing logic, with a hotfix released in version 7.4.4 and merged via PR #4241. The issue is closed. | |
| qwen/qwen3.6-35b-a3b | — | — | The AptGPGKeyInstallError regression on multi-key GPG files was fixed via PR #4241. The patch was merged and released to the edge channel. Despite some users reporting follow-up validation errors, the issue was closed after deployment. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after a fix was merged to resolve the AptGPGKeyInstallError caused by multi-key GPG files. The patch was released on the edge channel for testing, with a stable hotfix pending. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | A fix for the multiple GPG key parsing error was merged in PR #4241 and released in snapcraft 7.4.4. The regression was resolved and the issue closed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged via PR #4241 and released as snapcraft 7.4.4 hotfix. The fix resolves the GPG key parsing regression causing AptGPGKeyInstallError. Issue closed after deployment, though some users requested verification of the edge channel build. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4225 Regression: snapcraft "apt" package-repositories feature fails in destructive mode | snapcraft | closed | Fixed in Snapcraft 7.5. The regression causing permission denied errors for /etc/apt/keyrings in destructive mode was resolved by restoring sudo usage for core20. Verified working in 7.5.2 and closed. | |
| #2024910 Failed to install GPG key: Key must be a single key, not multiple. | snapcraft (launchpad) | closed | Snapcraft failed to install GPG keys when multiple keys were bundled in a single file during package-repositories setup. Fixed and merged via pull request #4253, restoring multi-key apt repository support. | |
| #4235 requirements: bump craft-archives to fix regression | snapcraft | closed | Merged into hotfix/7.4 to bump craft-archives, resolving regression #4224. The update restores support for asset files containing multiple keys, aligning with the previous apt-key behavior. | |
| #5635 Fail to run snapcraft using a proxy | snapcraft | closed | Fixed via craft-archives#165. The proxy-related GPG keyserver failure in snapcraft was resolved, and the reporter confirmed the fix works. Closed as fixed. |