Some kind of race condition is causing my gpg to fail. I can run gpg --sign several times and it will sometimes succeed. When it succeeds, I get a dialog asking for a passphrase. When it fails I can sometimes see the dialog for a fraction of a second, but then it aborts. This is the output when it fails: griffon26@griffon27 ~> gpg --sign You need a passphrase to unlock the secret key for user: "Maurice van der Pot (Griffon26) <griffon26@gentoo.org>" 1024-bit DSA key, ID B79A871C, created 2004-07-17 ** ERROR **: could not grab keyboard aborting... gpg-agent[5940]: command get_passphrase failed: End of file gpg: problem with the agent: IPC write error gpg: Invalid passphrase; please try again ... You need a passphrase to unlock the secret key for user: "Maurice van der Pot (Griffon26) <griffon26@gentoo.org>" 1024-bit DSA key, ID B79A871C, created 2004-07-17 gpg: problem with the agent: IPC write error gpg: no default secret key: General error gpg: signing failed: General error This has been happening since my upgrade to gnupg 2.0. It's currently preventing me from signing manifests. [ebuild R ] app-crypt/pinentry-0.7.2-r3 USE="gtk ncurses -caps -qt3" 390 kB [ebuild R ] app-crypt/gnupg-2.0.2 USE="X bzip2 -doc -ldap -nls -openct -pcsc-lite (-selinux) -smartcard" 0 kB
Created attachment 109261 [details, diff] pinentry-0.7.2-debug.patch Hmmm.... It seems that gdk_keyboard_grab is failing in pinentry. Have you used the same pinentry with gpg-1.4.X? Can you please try to apply the following patch so we know what is the error code? Thanks!
And the winner is... ** ERROR **: could not grab keyboard (3)
GDK_GRAB_NOT_VIEWABLE the grab window or the confine_to window are not viewable. You did not answer, have you used the same pinentry with previous version?
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401957
It doesn't look like it. According to emerge.log pinentry was first installed in january 2007 and my last successful signing was done in october 2006.
Have you tried the solution in comment#4?
Created attachment 109354 [details, diff] pinentry-0.7.2-debug.patch Please try this one, it is the patch from comment#4.
I tried it. It didn't change anything afaics.
Hello gnome, I will appreciate any thought regardging this issue.
Here's the relevant portion of code from pinentry: 88 /* Grab the keyboard for maximum security */ 89 static void 90 grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) 91 { 92 if (!pinentry->grab) 93 return; 94 95 if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event))) 96 g_error ("could not grab keyboard"); 97 }
Looking at it, the patch in comment #7 should probably work. Without more info (does the error code change with that patch?) I can't help more...
(In reply to comment #11) > Looking at it, the patch in comment #7 should probably work. Without more info > (does the error code change with that patch?) I can't help more... > Thanks! As per comment#8, it seems that the same error code is produced... Maurice: Can you please re-verify that?
Done. There is no change. It still fails sometimes with the same error code.
Finally, can open bugs in upstream.
Created attachment 122155 [details, diff] fix This patch changes the map/unmap events, that seem to occur too early, with expose/no-expose events. This seems to fix the bug.
Yes, it looks like this patch solves the problem. Thanks!
Thank you!!!
Please check 0.7.4, werner reverted this patch with something else... Thanks!
Thanks for the heads-up. And you were right to be concerned; the problem is back again. Pinentry 0.7.4 is broken: /pinentry> pinentry OK Your orders please GETPIN ** ERROR **: could not grab keyboard aborting... Aborted /pinentry>
Thanks! I don't know how you can reproduce this. Patch readded.