My Debian box decided to upgrade from "gnupg 1.4" to "gnupg 2.1" after some kind of security update.

After this, I am no longer able to use or access any of my keys.

After any gpg command, it says:

gpg: Ohhhh jeeee: Assertion "uids_seen == uid_no" in skip_unusable failed (../../g10/getkey.c:982)

I cannot figure out if there's a particular key at fault or if there is a general problem.

I ended up downgrading and everything works as it did before. (I used APT pinning to prevent gnupg from upgrading again.)

Aside: as an experiment, I changed /usr/bin/gpg to be a symlink to /usr/bin/gpg2 after the downgrade. I.e., always use gnupg 2.0 . Everything works, 'tho, occasionally, I'll get "gpg: Note: signatures using the MD5 algorithm are rejected" for certain secret keys.

Am I forever banished to use gpg 1.4? Or, is there a safe upgrade path to gpg 2.1?


An assertion is a sanity check in code where the code checks for a condition that should always be true, and will terminate the program if it is false, indicating a bug or data corruption. The assertion you are getting is located here in the code. The comment hints at the purpose of the assertion:

/* If UID_NO is non-zero, then the keyblock better have at least
   that many UIDs.  */
log_assert (uids_seen == uid_no);

My guess is that you have a mildly corrupt key where the number of UIDs in the key differ from the number of UIDs the key claims to have. GnuPG 1.4 may not have had any problem with that and happily accepted the corrupt key (the same function in 1.4 does not have the assertion), but 2.1 added a sanity check that now rejects the corrupt key. It certainly isn't an unrecoverable error. My advice would be to export your keypair in GnuPG 1.4, and then import it in 2.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.