← Back to issue list

Fail to run snapcraft using a proxy

View original Github issue

Metadata

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

Current evaluation

Proxy-related GPG key retrieval was fixed in craft-archives#189 (daf89a2) and adopted by snapcraft#5670; the reporter confirmed the failure no longer occurs.

Resolution: closed resolved

Reason: craft-archives PR #189 merged commit daf89a2, adding a TCP/80 keyserver fallback for proxied environments. Snapcraft PR #5670 updated the dependency, and the reporter verified the fix.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description I am trying to build snapd in the new PS7 environment where a proxy is used to connect to the keyring server and I get the following error: https://pastebin.canonical.com/p/RRv3dtmxHv/ ### To Reproduce Create a vm in PS7 environment Download snapd code Run snapcraft ### Environment Tried Snapcraft in destructive-mode and with lxd Fail in arm64 and amd64 ### snapcraft.yaml ```yaml https://github.com/canonical/snapd/blob/master/build-aux/snap/snapcraft.yaml ``` ### Relevant log output ```shell 2025-07-21 15:22:06.142 Executing command: ['gpg', '--batch', '--no-default-keyring', '--with-colons', '--keyring', 'gnupg-ring:/etc/apt/keyrings/craft-FC42E99D.gpg', '--homedir', '/tmp/tmpcsizdqmv', '--keyserver', 'keyserver.ubuntu.com', '--recv-keys', '78E1918602959B9C59103100F1831DDAFC42E99D'] 2025-07-21 15:22:46.367 Failed to install GPG key: 2025-07-21 15:22:46.372 Traceback (most recent call last): 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/snapcraft/application.py", line 467, in main 2025-07-21 15:22:46.372 return app.run() 2025-07-21 15:22:46.372 ^^^^^^^^^ 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/craft_application/application.py", line 615, in run 2025-07-21 15:22:46.372 return_code = self._run_inner() 2025-07-21 15:22:46.372 ^^^^^^^^^^^^^^^^^ 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/snapcraft/application.py", line 178, in _run_inner 2025-07-21 15:22:46.372 return_code = super()._run_inner() 2025-07-21 15:22:46.372 ^^^^^^^^^^^^^^^^^^^^ 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/craft_application/application.py", line 561, in _run_inner 2025-07-21 15:22:46.372 dispatcher = self._get_dispatcher() 2025-07-21 15:22:46.372 ^^^^^^^^^^^^^^^^^^^^^^ 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/snapcraft/application.py", line 405, in _get_dispatcher 2025-07-21 15:22:46.372 self._check_for_classic_fallback() 2025-07-21 15:22:46.372 File "/snap/snapcraft/15370/lib/python3.12/site-packages/snapcraft/application.py", line 317, in _check_for_classic_fallback 2025-07-21 15:22:46.372 raise errors.ClassicFallback() 2025-07-21 15:22:46.372 snapcraft.errors.ClassicFallback ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Proxy-related GPG key retrieval was fixed in craft-archives#189 (daf89a2) and adopted by snapcraft#5670; the reporter confirmed the failure no longer occurs.
stealth/space-bunny-alpha — closed resolved Fixed upstream in craft-archives PR #189 (commit daf89a2), which retries GPG key retrieval over TCP/80 when the default keyserver times out; the reporter confirmed the proxy failure no longer reproduces.
qwen/qwen3.6-35b-a3b — — 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.
qwen/qwen3.6-35b-a3b — — Fixed via canonical/craft-archives#165. The proxy-related GPG key retrieval failure in snapcraft was resolved, and the reporter confirmed the fix works correctly.
qwen/qwen3.6-35b-a3b — — Resolved via canonical/craft-archives#165. The proxy-related GPG key retrieval failure in snapcraft was fixed, and the reporter verified the issue no longer occurs.
qwen/qwen3.6-35b-a3b — — Resolved via canonical/craft-archives#165. Proxy environments caused GPG keyserver timeouts, triggering a ClassicFallback error. The upstream craft-archives update fixed the connectivity issue, verified by the reporter.
qwen3.6-35b-a3b-mtp-q6 — — Resolved via a fix in craft-archives issue #165. The update corrects GPG key retrieval failures when snapcraft runs behind a proxy. The reporter verified the fix eliminates the error during builds.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-archives#189 (confidence 100%)

    Merged commit daf89a2 added retry over TCP/80 and fixed upstream issue #165.

  • Likely Fixed By: canonical/snapcraft#5670 (confidence 100%)

    Merged snapcraft dependency update to craft-archives 2.1.1, incorporating the fix.

  • Related To: canonical/craft-archives#165 (confidence 100%)

    Upstream issue tracked the keyserver port change that resolved this Snapcraft report.

Related issues

Issue Project State Summary Similarity
#4224 Regression: snapcraft started failing with craft_archives.repo.errors.AptGPGKeyInstallError snapcraft closed Multi-key APT GPG parsing regression was fixed by merged PR #4253 (a311e7c), updating craft-archives and shipping in the Snapcraft 7.4.4 hotfix.
74%
#165 Consider changing keyserver to hkp://keyserver.ubuntu.com:80 craft-archives closed Fixed by craft-archives PR #189 (commit daf89a2): key retrieval now retries via hkp://keyserver.ubuntu.com:80 with proxy handling. Downstream snapcraft PR #5670 merged.
72%
#34 Snapcraft cannot authenticate proxy.golang.org snapcraft-rocks open Go builds via Snapcraft fail TLS verification against proxy.golang.org in the 7_core22 container. Maintainers traced it to CA certificates and two merged snapcraft PRs addressed it; issue left open since Apr 2024.
71%