by

WARNING: server ‘gpg-agent’ is older than us

I ran into the following error this morning, using the Pass utility:

 1$ pass -c foo/bar
 2gpg: starting migration from earlier GnuPG versions
 3gpg: WARNING: server 'gpg-agent' is older than us (2.0.30 < 2.1.21)
 4gpg: error: GnuPG agent version "2.0.30" is too old.
 5gpg: Please make sure that a recent gpg-agent is running.
 6gpg: (restarting the user session may achieve this.)
 7gpg: migration aborted
 8gpg: decryption failed: No secret key
 9There is no password to put on the clipboard at line 1.

From what I’ve seen online, you can also see this problem using GPG by means other than through Pass. In any case, I couldn’t find a fix, and I was starting to be worried I couldn’t access my passwords any more, or at least not easily.

Fortunately, I could figure out what was going on by reading the error closely. Looks like there was a version of gpg-agent running that was different from the one expected by GnuPG. Also, some migration was expected to occur between the old and the new version. Therefore I had to shut down the old version so that this migration could take place:

1$ gpgconf --kill gpg-agent

Then I ran my command again. This time the underlying gpg command runs its migration successfully and then allows Pass to resume as if nothing had happened:

1$ pass -c foo/bar
2gpg: starting migration from earlier GnuPG versions
3gpg: porting secret keys from '/Users/pablobm/.gnupg/secring.gpg' to gpg-agent
4gpg: migration succeeded
5Copied foo/bar to clipboard. Will clear in 45 seconds.