‘guix lint’ throws an ugly backtrace if the GitHub updater receives “rate limit exceeded” error
(address . bug-guix@gnu.org)
When running ‘guix lint -c refresh’ on a package hosted on GitHub, I get
an ugly backtrace when the GitHub rate limit has been reached.
Toggle snippet (39 lines)
$ guix lint pipewire
fetching CVE database for 2021...
fetching CVE database for 2018...
Backtrace:ipewire@0.3.29 [refresh]...
15 (primitive-load "/home/yoctocell/.config/guix/current/b…")
In guix/ui.scm:
2206:7 14 (run-guix . _)
2169:10 13 (run-guix-command _ . _)
In ice-9/boot-9.scm:
1752:10 12 (with-exception-handler _ _ #:unwind? _ # _)
1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
658:37 10 (thunk)
In srfi/srfi-1.scm:
634:9 9 (for-each #<procedure 7fb8f038ff40 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
65:4 8 (run-checkers _ _ #:store _)
In srfi/srfi-1.scm:
634:9 7 (for-each #<procedure 7fb8e15a8d20 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
74:21 6 (_ _)
In guix/lint.scm:
1428:5 5 (check-for-updates #<package pipewire@0.3.29 gnu/packag…>)
771:2 4 (call-with-networking-fail-safe _ _ _)
In ice-9/boot-9.scm:
1752:10 3 (with-exception-handler _ _ #:unwind? _ # _)
1685:16 2 (raise-exception _ #:continuable? _)
1683:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
ERROR:
1. &http-get-error:
uri: #<<uri> scheme: https userinfo: #f host: "api.github.com" port: #f path: "/repos/PipeWire/pipewire/releases" query: #f fragment: #f>
code: 403
reason: "rate limit exceeded"
2. &message: "https://api.github.com/repos/PipeWire/pipewire/releases: HTTP download failed: 403 (\"rate limit exceeded\")"
When running ‘guix refresh’, a much friendlier error message is produced.
Toggle snippet (4 lines)
$ guix refresh -t github
guix refresh: error: https://api.github.com/repos/OpenZWave/open-zwave/releases: HTTP download failed: 403 ("rate limit exceeded")
The problem seems to be that the ‘check-for-updates’ procedure in (guix
lint) doesn’t catch the ‘&http-get-error’. I tried adding the following
form:
Toggle snippet (8 lines)
(guard (c ((and (http-get-error? c)
(string=? "rate limit exceeded"
(http-get-error-reason c)))
(warning (G_ "GitHub rate limit exceeded"))
#f))
(with-networking-fail-safe ...))
but it doesn’t work. C seems to be something a lot more complicated
than just a ‘&http-get-error’:
Toggle snippet (3 lines)
#<&compound-exception components: (#<&error> #<&irritants irritants: (#<&compound-exception components: (#<&http-get-error uri: #<<uri> scheme: https userinfo: #f host: "api.github.com" port: #f path: "/repos/PipeWire/pipewire/releases" query: #f fragment: #f> code: 403 reason: "rate limit exceeded"> #<&message message: "https://api.github.com/repos/PipeWire/pipewire/releases: HTTP download failed: 403 (\"rate limit exceeded\")">)>)> #<&exception-with-kind-and-args kind: %exception args: (#<&compound-exception components: (#<&http-get-error uri: #<<uri> scheme: https userinfo: #f host: "api.github.com" port: #f path: "/repos/PipeWire/pipewire/releases" query: #f fragment: #f> code: 403 reason: "rate limit exceeded"> #<&message message: "https://api.github.com/repos/PipeWire/pipewire/releases: HTTP download failed: 403 (\"rate limit exceeded\")">)>)>)>
Any ideas on how to extract to the ‘&http-get-error’?
-----BEGIN PGP SIGNATURE-----
iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmG8mLkVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5PDoP/3fUDQQMLHfcP/1+dg3qwwJ8hkO3
7Rv+Fuy2gFF2Gf/bCqY3dPEfMYoddKTzWqxJNf2ImalSoMdPGNx0JJS7nkVTJygg
ETsKxGMcyYfBfSRcmxKH1NHkQnrjw4ZB4ih1OvUDpGaV2ZJDOetgELh0lNaDjznr
8s5EtjVn78SBVYJMgi6MFLtyow4d/7wM1lyt5nftO8BdOmW2WkM8KXYYVSpGfbfK
aSh+EKIFAVFHBYLwTXnSTmdaP5CydWIMmEiUkzmi88pmmYfQVI2Kzvku0THX9C3E
78oN/PWc/Xjcipz/o5PcXYYoSYwmpuqpUGNjg6blwCG+9S0f7XwYE5E81mlsMaog
IIwYhqDSqxaywKtKgFXW2aMDFQSYt0v6naqdxEa4nDfpoL+CoFxkhBInxeoCwqYl
mxjN5y1ncC1Fjq4+2Xn9bNyXqN3Q2xu5YYUwvjXMZVSfN/rYZRyKKB6yirOWN0my
5+wl591PKxSp3c05Z2uOHZGgoZ1mJ6KOaFc9q2nTeL3MCPtYz9M72wmFaHks9NRv
ZEefS485JqsTPvVpaERGfGV571Yiu+72a6bRMkf/omHiinulqXImcOL6TDmgVWdQ
YNXOkzOuNY5/I/U83Eu7M4yHy/BXj7o62Noz0pOztEagMaoe1o3PzMfZWhywjw1R
icMMKr78cMgQpBQ5
=hlsS
-----END PGP SIGNATURE-----