Summary: | app-crypt/gnupg: --refresh-keys fails if ipv6 is not supported (was: app-portage/gemato, sys-apps/portage: emerge --sync fails on verification) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Xavier Miller (RETIRED) <xaviermiller> |
Component: | Current packages | Assignee: | Kristian Fiskerstrand (RETIRED) <k_f> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexander, anton.kochkov, bertrand, burcheri.massimo+bugs-gentoo, crypto+disabled, dev-portage, gentoo, herrtimson, mgorny, polynomial-c, rzubaly, sam, viklevin2 |
Priority: | Normal | Keywords: | UPSTREAM |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/mgorny/gemato/issues/3 https://dev.gnupg.org/T3331 https://bugs.gentoo.org/show_bug.cgi?id=779766 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 646934 | ||
Bug Blocks: | |||
Attachments: | 0001-dirmngr-Handle-failures-related-to-missing-IPv6-grac.patch |
Description
Xavier Miller (RETIRED)
![]() This is clearly a bug in gpg. Neither gemato nor gentoo-keys force ipv6 in any way. I believe upstream's response is that it is a misconfigured system if you encounter this, so ipv6 should either be disabled system-wide using net.ipv6.conf.all.disable_ipv6 = 1 or disable-ipv6 in dirmngr. See https://dev.gnupg.org/T3331 for discussion, including some of my comments from august 2017. I added a /etc/dirmngr/dirmngr.conf file with "disable-ipv6" Now it syncs and checks the contents :) sent 32.20K bytes received 5.47M bytes 579.05K bytes/sec total size is 224.33M speedup is 40.78 INFO:root:Refreshing keys from keyserver... INFO:root:Keys refreshed. INFO:root:Manifest timestamp: 2018-01-31 11:08:16 UTC INFO:root:Valid OpenPGP signature found: INFO:root:- primary key: DCD05B71EAB94199527F44ACDB6B8C1F96D8BF6D INFO:root:- subkey: E1D6ABB63BFCFB4BA02FDF1CEC590EEAC9189250 INFO:root:- timestamp: 2018-01-31 11:08:16 UTC INFO:root:Verifying /usr/portage... INFO:root:/usr/portage verified in 51.75 seconds === Sync completed for gentoo For gemato, one way is to add dirmngr.conf to the temporary homedir created in line 185 on in gemato/openpgp.py with disable-ipv6 , that would ensure proper run without impacting user/system configuration Created attachment 517256 [details, diff]
0001-dirmngr-Handle-failures-related-to-missing-IPv6-grac.patch
Here's the patch I came up with. It's trivial, and it fixes the issues when IPv6 is enabled via procfs for me. The other 'case' should cover the case of it being disabled in kernel but I'd appreciate if one of you could test it.
Please note that GnuPG chooses between different IP addresses randomly, so you may need to bash it for a while to get it to fail ;-). You may do something like 'killall dirmngr; strace -ff gpg --refresh-keys |& less' to verify if it tried to use IPv6 during the test.
Thanks Michał for the patch. I also had "Address family not supported by protocol" error when IPv6 address was selected. I have no IPV6 in kernel so there is no /proc/sys/net/ipv6 to disabled_ipv6 to begin with. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b580348546711590c0152a8371e3cf00393b4720 commit b580348546711590c0152a8371e3cf00393b4720 Author: Kristian Fiskerstrand <k_f@gentoo.org> AuthorDate: 2018-02-07 20:42:38 +0000 Commit: Kristian Fiskerstrand <k_f@gentoo.org> CommitDate: 2018-02-07 20:42:38 +0000 app-crypt/gnupg: Add fix for missing IPv6 stack Bug: https://bugs.gentoo.org/646194 Package-Manager: Portage-2.3.19, Repoman-2.3.6 ...r-Handle-failures-related-to-missing-IPv6.patch | 31 +++++ app-crypt/gnupg/gnupg-2.2.4-r2.ebuild | 130 +++++++++++++++++++++ 2 files changed, 161 insertions(+)} The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cdccbb4f67a6e3586df619a689ee9a7306ffe7d commit 9cdccbb4f67a6e3586df619a689ee9a7306ffe7d Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-02-07 21:34:58 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-02-07 21:38:56 +0000 sys-apps/portage: Require app-crypt/gnupg with IPv6 fix Depend on >=app-crypt/gnupg-2.2.4-r2 to avoid failing verification on systems that are missing an IPv6 stack. More importantly, this ensures that we will not stabilize Portage before that version of GnuPG. Bug: https://bugs.gentoo.org/646194 sys-apps/portage/{portage-2.3.24.ebuild => portage-2.3.24-r1.ebuild} | 2 +- sys-apps/portage/portage-9999.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)} GnuPG is fixed now, and Portage has appropriate deps. I guess that's all to be done here. I have same error again:
# eix-sync
* Running emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
* Using keys from /usr/share/openpgp-keys/gentoo-release.asc
* Refreshing keys from keyserver ...OpenPGP keyring refresh failed:
gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: General error
OpenPGP keyring refresh failed:
gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: General error
Installed version is:
app-crypt/gnupg-2.2.4-r2
(In reply to Tomas Rusnak from comment #10) > I have same error again: > > # eix-sync > * Running emerge --sync > >>> Syncing repository 'gentoo' into '/usr/portage'... > * Using keys from /usr/share/openpgp-keys/gentoo-release.asc > * Refreshing keys from keyserver ...OpenPGP keyring refresh failed: > gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net > gpg: keyserver refresh failed: General error > > OpenPGP keyring refresh failed: > gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net > gpg: keyserver refresh failed: General error > > Installed version is: > app-crypt/gnupg-2.2.4-r2 The root cause may not be exactly the same as the IPV6 issue fixed in app-crypt/gnupg/gnupg-2.2.4-r2, so please open a new bug report. Actually I have a cron job that showed the "General error" today. The cron job runs every 30 minutes, with lots of retry just like emerge, and a cron email was sent 5 Jul 2018 19:55:42 +0000 (UTC). (In reply to Zac Medico from comment #12) > Actually I have a cron job that showed the "General error" today. The cron > job runs every 30 minutes, with lots of retry just like emerge, and a cron > email was sent 5 Jul 2018 19:55:42 +0000 (UTC). I'd still prefer a separate bug for it, in particular one that includes dirmngr log (dirmngr.conf: log-file /path/to/file.log\ndebug-level guru) and gpgconf --kill dirmngr Before I found this ticket I created https://dev.gnupg.org/T4817 . Even with --disable-ipv6 it doesn't work. Any other workaround? The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=9268a92b9666eaaf263999b18220c0d56d8c476c commit 9268a92b9666eaaf263999b18220c0d56d8c476c Author: Sam James <sam@gentoo.org> AuthorDate: 2023-08-13 04:36:04 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-08-17 06:52:55 +0000 sync: rsync, git: respect --debug for gemato Respect --debug and pass it down to gemato so we get nice debugging output when e.g. 'refreshing keys' is stuck. Bug: https://bugs.gentoo.org/646194 Bug: https://bugs.gentoo.org/647696 Bug: https://bugs.gentoo.org/691666 Bug: https://bugs.gentoo.org/779766 Bug: https://bugs.gentoo.org/873133 Bug: https://bugs.gentoo.org/906875 Bug: https://github.com/projg2/gemato/issues/7 Bug: https://github.com/projg2/gemato/issues/25 Signed-off-by: Sam James <sam@gentoo.org> lib/portage/sync/modules/git/git.py | 15 +++++++++++++-- lib/portage/sync/modules/rsync/rsync.py | 11 +++++++++-- lib/portage/sync/syncbase.py | 12 ++++++++---- 3 files changed, 30 insertions(+), 8 deletions(-) |