Invalid IPC response on Windows 11

Hi, GPG4Win teams

I have two PCs that runs Windows 11 and Kleopatra. I’ve been using gpg normally for months.

But recently the GPG on two PCs fail with the messasge Invalid IPC response.

The pinentry-qt window can pop up as expected. But no matter what passphrase I type in the pinentry-qt dialog window, it shows the same error message.

Snipaste_2024-09-30_11-20-12

As a temporary workaround, I can use --pinentry-mode loopback argument in cli to enter the passphrase without the GUI. I think the problem is in pinentry or something related to it.

I’m using Windows 11 23H2 and GPG4Win 4.3.1. Have tried uninstall and install again.

I can provide a level 4 (full) debug output from GPG. But I’m not sure it contains any sensitive information like my private key. Can I post it here?

If I use cli with --pinentry-mode loopback to type passphrase, the Kleopatra will function for some time. I believe that’s because the passphrase cache works.

Same for me. Did you found the solution, instead of using pinentry-mode loopback?

Currently I’ve no idea. But I believe the Windows update break something. Are you using windows 11?

Would you test if pinentry is working correctly?

Call pinentry.exe on the command line, it should be installed art C:\Program Files (x86)\Gpg4win\bin

Enter GETPIN at the new prompt, then enter something in the pinentry window and check if the test entry you gave is shown in the cli.

Thanks for the reply.

I’ve tested with GETPIN. It seems working.

ORnIXVvlfB


I also tried to rename pinentry-w32.exe to pinentry.exe to force GPG4Win to use the legacy pinentry. The prompt can show up but the problem still exists.

KekEKGLwYt

ok, next we should have a look at an gpg-agent log.

For this put in your gpg-agent.conf:

debug-pinentry
debug ipc
log-file C:\Users\USERNAME\PATH\debug-output.txt

Substitute the UPPERcase words accordingly.
If gpg-agent.conf does not exist at %APPDATA%\gnupg, create it.

Restart background processes.

Then do something which requires pinetry. What does the log output say?

Thanks, the output is https://pastebin.com/raw/R8n098As

Could you check that?

Thanks for the log. However it does not really help us. To better be able to replicate the problem it would be helpful to get the output of

gpgconf -X

or

gpgconf -X > gpgconf-output.txt

and send us the file. Check the content for private infos - should not be the case but you never know.

Thanks Werner,

The gpgconf output is https://pastebin.com/raw/tcRMzWQK

I’m kind of thinking this is really hard to debug. Just tried a fresh install Windows 11 IoT 24H2 and it works.

Unfortunately no real insights from the new log file.

We need to do another debug session; keep the log configuration for
gpg-agent but stop gpg-agent (gpgconf -K all) and delete the old log
file. Then run this

gpg-connect-agent -v

On the command prompt show enter:

get_passphrase X X X X

and enter a dummy value into the pinentry window. Here is an example
session (On linux in this case):

gpg-connect-agent -v

get_passphrase X X X X
OK 31323334
quit
ERR 67109139 Unknown IPC command

gpg-connect-agent: closing connection to agent

As you can see, I entered 1234 as PIN and it is show in hex encoding.
In you session you should also see something about “starting
gpg-agent”.

Please now check the gpg-agent log file to see where
there are any errors?

Thanks Werner,

I’m afraid it’s still not very helpful. The debug output is: https://pastebin.com/raw/8VZ4pdNK

NjQAuV7ibw

Tricky. Can you please test again after setting the language for your session to C or en_US?
If I would be able to replicate this on my box I would add some debug code to pinentry or on Unix to use a pinentry wrapper which rund pinnetry under strace

Oh you are right. I changed system locale to English and it works somehow.

WVBNHsBFxj

Then something weird came - I changed Windows display language back to zh_CN, and it still worked.

Since I can’t reproduce the error any more, I think we can hold it for now. Thanks again Werner.

I’ll test the workaround on my another PC tomorrow. If I have result I’ll update.

Did you already tested it with cmd.exe instead of PS?