emerge – cannot sync with gpg: keyserver refresh failed: General error because of wrong date

Trying to sync one of our virtual servers we got a sync error not able to refresh the OpenPGP keys. The virtual server was just resumed and it was OK before the pause. In addition, there were no errors in dmesg or some kind of kernel panics. All seemed to be working even the server was in the distributed compiling node and no problems there. But still, the emerge syncing the portage tree wasn’t possible!
And the problem was the date of our virtual server, which was 4 months behind the real date!

Check the time and date of the server – if it is behind or in the future with a big interval this is the root of the problems with the inability to refresh the GPG keys.

Just synchronize the clock of the server and be careful when you resume pause virtual servers! When you resume them you should synchronize the clock because in multiple environments the clock might be wrong!
We have multiple articles on the time syncronization topic – openntpd – immediately sync the clock on startup, simple time synchronization of a server (laptop, desktop) using built-in systemd-timesyncd service and more.

compile-local ~ # 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

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

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

OpenPGP keyring refresh failed:
gpg: refreshing 4 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: General error

^C

Exiting on signal Signals.SIGINT
compile-local ~ # date
Sat 08 Apr 2019 15:11:39 PM -00
compile-local ~ # /etc/init.d/ntpd restart
 * Starting OpenNTPD ...                                                                                                                                              [ ok ]
compile-local ~ # date
Sun 01 Sep 2019 08:02:34 AM -00
compile-local ~ #


Websync also does not work! Seeing the date it tries to download could point you out the problem with the date! Multiple missing portage files starting from the date “20190417” i.e. 2019/04/17.

compile-local ~ # emerge-webrsync
Fetching most recent snapshot ...
Trying to retrieve 20190417 snapshot from http://distfiles.gentoo.org ...
Fetching file portage-20190417.tar.xz.md5sum ...
Fetching file portage-20190417.tar.bz2.md5sum ...
Fetching file portage-20190417.tar.gz.md5sum ...
20190417 snapshot was not found
Trying to retrieve 20190416 snapshot from http://distfiles.gentoo.org ...
Fetching file portage-20190416.tar.xz.md5sum ...
Fetching file portage-20190416.tar.bz2.md5sum ...
Fetching file portage-20190416.tar.gz.md5sum ...
20190416 snapshot was not found
Trying to retrieve 20190415 snapshot from http://distfiles.gentoo.org ...
Fetching file portage-20190415.tar.xz.md5sum ...
Fetching file portage-20190415.tar.bz2.md5sum ...
Fetching file portage-20190415.tar.gz.md5sum ...
20190415 snapshot was not found
Trying to retrieve 20190414 snapshot from http://distfiles.gentoo.org ...
Fetching file portage-20190414.tar.xz.md5sum ...
Fetching file portage-20190414.tar.bz2.md5sum ...
Fetching file portage-20190414.tar.gz.md5sum ...
20190414 snapshot was not found
Trying to retrieve 20190413 snapshot from http://distfiles.gentoo.org ...
Fetching file portage-20190413.tar.xz.md5sum ...
Fetching file portage-20190413.tar.bz2.md5sum ...
Fetching file portage-20190413.tar.gz.md5sum ...
20190413 snapshot was not found

Leave a Reply

Your email address will not be published.