"Unknown IPC command" in many situations (gpg4win/gnupg conflict?)
Closed, InvalidPublic

Description

Hi,

I'm using the GPG 2.1.5 build from gnupg.org on Windows 8.1

When I'm trying to do several actions in GnuPG, I'm presented with an "Unknown
IPC command" message.

Examples of this are:

gpg --verbose --search-keys mail@lenzw.de

gpg: error searching keyserver: Unknown IPC command
gpg: keyserver search failed: Unknown IPC command

gpg --recv-key B76C94DD

gpg: keyserver receive failed: Unknown IPC command

This is executing it in a CMD with the only gpg on path being above installation.

Executing it from MSYS2 (here, the FIRST gpg, gpg-agent etc. on path are the
above mentioned installation, there is another gpg 1.4.19 in /usr/bin), it
already fails me on

% gpg-connect-agent /bye
ERR 67109139 Unknown IPC command <GPG Agent>

Another detail that may or may not be important: I'm using a smartcard reader in
this setup.

Most "normal" commands (encryption, decryption, key editing etc.) work fine though.

Details

Version
2.1.5
phry set Version to 2.1.5.
phry added a subscriber: phry.
werner added a subscriber: werner.Jun 25 2015, 2:57 PM

It is very likely that you are running an older gpg-agent (from gpg4win ?) which
does not support GnuPG 2.1. Please de-install gpg4win first.

phry added a comment.Jun 25 2015, 5:53 PM

Yes and no.
The gpg-agent process running was definitely the 2.1.5 version (see screenshots).

But nontheless, uninstalling GPG4Win solved the problem.

On a sidenote: I had installed GPG4Win solely for the purpose of using it's
pinentry, as it was playing along with my SmartCard-Reader better than the GnuPG
version (pinentry on the device vs on screen) - but somewhere in one of the
later updates, the GnuPG-Pinentry seems to have caught up - everything works now
with just one installation - thanks :)

phry added a comment.Jun 25 2015, 5:55 PM

Oh, and thanks overall for making me uninstall GPG4Win :)

The screenshots show the program but not the running process. It is quite
possible that the older one is still running. If that happens again, please run

  gpg-connect-agent 'getinfo version' /bye

to show the version of the running gpg-agent.

phry added a comment.Jun 26 2015, 1:13 PM

It's the running process information from the task manager (right-click the
running process, properties) - I would be astonished if Microsoft would screw
even that up.

Just for testing it, I reinstalled GPG4Win:

% gpg-connect-agent 'getinfo version' /bye
D 2.1.5
OK
ERR 67109139 Unknown IPC command <GPG Agent>

% gpg --version
gpg (GnuPG) 2.1.5
[...]

% gpg-connect-agent --version
gpg-connect-agent (GnuPG) 2.1.5
[...]

% scdaemon --version
scdaemon (GnuPG) 2.1.3

So it is using the right executables for gpg-agent, gpg-connect-agent and gpg,
but as long as GPG4Win is installed in another directory, it fails on some IPC
Commands..
Scdaemon seems to be 0.0.2 versions behind, which irritates me a bit. But it's
definitely not the one from GPG4Win.

Values from within the GPG4Win directory:

weber in /c/Program Files (x86)/GNU/GnuPG [13:09:03]
% ./gpg2.exe --version
gpg (GnuPG) 2.0.27 (Gpg4win 2.2.4)

% ./gpg-agent.exe --version
gpg-agent (GnuPG) 2.0.27 (Gpg4win 2.2.4)

% ./scdaemon.exe --version
scdaemon (GnuPG) 2.0.27 (Gpg4win 2.2.4)

% ./gpg-connect-agent.exe --version
gpg-connect-agent (GnuPG) 2.0.27 (Gpg4win 2.2.4)

Sorry, I only noticed the properties page and I never use teh task manager
(sysinternals Process Epxlorer is much more useful). The different version
number of scdaemon is an indication that an older version is still installed or
at least running.

To see GnuPG's idea of the installed programs you can use

  gpgconf

or to actually test whether they are installed:

gpgconf --check-programs
phry added a comment.Jun 26 2015, 1:41 PM

Hmm, let's see:

GPG with GPG4Win installed (I indented it a bit):

% gpgconf --check-programs
gpg:GPG for OpenPGP: C%3a\Program Files (x86)\GnuPG\bin\gpg.exe:1:1:
gpg-agent:GPG Agent: C%3a\Program Files
(x86)\GnuPG\bin\gpg-agent.exe:1:1:
scdaemon:Smartcard Daemon: C%3a\Program Files
(x86)\GnuPG\bin\scdaemon.exe:1:1:
gpgsm:GPG for S/MIME: C%3a\Program Files (x86)\GnuPG\bin\gpgsm.exe:1:1:
dirmngr:Directory Manager: C%3a\Program Files
(x86)\GnuPG\bin\dirmngr.exe:1:1:
pinentry:PIN and Passphrase Entry: C%3a\Program Files
(x86)\GnuPG\bin\pinentry-basic.exe:1:1:

after the deinstallation of GPG4Win:

gpg:GPG for OpenPGP: C%3a\Program Files (x86)\GnuPG\bin\gpg.exe:1:1:
gpg-agent:GPG Agent: C%3a\Program Files
(x86)\GnuPG\bin\gpg-agent.exe:1:1:
scdaemon:Smartcard Daemon: C%3a\Program Files
(x86)\GnuPG\bin\scdaemon.exe:1:1:
gpgsm:GPG for S/MIME: C%3a\Program Files (x86)\GnuPG\bin\gpgsm.exe:1:1:
dirmngr:Directory Manager: C%3a\Program Files
(x86)\GnuPG\bin\dirmngr.exe:1:1:
pinentry:PIN and Passphrase Entry: C%3a\Program Files
(x86)\GnuPG\bin\pinentry-basic.exe:1:1:

From within the GPG4Win folder:
weber in /c/Program Files (x86)/GNU/GnuPG [13:26:16]
% ./gpgconf --check-programs
gpg:GPG for OpenPGP: C%3a\Program Files (x86)\GNU\GnuPG\gpg2.exe:1:1:
gpg-agent:GPG Agent: C%3a\Program Files (x86)\GNU\GnuPG\gpg-agent.exe:1:1:
scdaemon:Smartcard Daemon: C%3a\Program Files (x86)\GNU\GnuPG\scdaemon.exe:1:1:
gpgsm:GPG for S/MIME: C%3a\Program Files (x86)\GNU\GnuPG\gpgsm.exe:1:1:
dirmngr:Directory Manager: C%3a\Program Files (x86)\GNU\GnuPG\dirmngr.exe:1:1:

The old scdaemon could be some problem with the setup - I had 2.1.13 installed,
but before filing this bug-report, I used the installer from gnupg.org to udpate
to a current version to re-check the behaviour.

But I think I may have two separate problems here now:

  • "Unknown IPC command" on recv-keys (from cmd and zsh) - it seems I can't

reproduce this after reinstalling GPG4Win. Maybe my environment was screwed up
without me noticing it.

  • "Unknown IPC command" on gpg-connect-agent <command> /bye (only in zsh) -

this seems to be persistent, but I just noticed if I add an empty argument
between the command and the /bye, I don't get the "Unknown IPC Command".
Which means gpg-connect-agent '' /bye works flawlessly. Maybe something to do
with MSYS2 or zsh.

Sorry for being such a weird case xD

phry added a comment.Jun 26 2015, 1:46 PM

PS: The second problem is persistent if GPG4Win is installed or not. But
knowing how to handle it, I think it's no real problem.

werner renamed this task from "Unknown IPC command" in many situations to "Unknown IPC command" in many situations (gpg4win/gnupg conflict?).Aug 18 2016, 12:56 PM
marcus closed this task as Invalid.Jul 21 2017, 5:20 PM