Ubuntu 18.04 gpg dirmngr IPC connect call failed
-
Your Windows build number: 10.0.17134.81
-
What you're doing and what's happening:
Building MonoDevelop for Windows looks like a real hassle and there are no binaries available.
I decided to give MonoDevelop for Ubuntu binaries a try on WSL.
I installed a clean Ubuntu 18.04 from the Microsoft Store.
To get it all caught up I executed:
sudo apt-mark hold ebtables # for the current upgrade bug
sudo apt-get update
sudo apt-get upgrade -y
and then I picked up with the MonoDevelop IDE instructions:
sudo apt install apt-transport-https dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Then I run into an issue.
I receive the following error message:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
[sudo] password for hayden:
Executing: /tmp/apt-key-gpghome.BG01sRSmD5/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.BG01sRSmD5/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr
- What's wrong / what should be happening instead:
gpg isn't able to call dirmngr
What I have attempted:
- Running dirmngr in another bash instance
- Making sure gpg-agent is running in the background
- This. https://stackoverflow.com/questions/49496667/gpg-key-generation-canceled and https://stackoverflow.com/questions/46673717/gpg-cant-connect-to-the-agent-ipc-connect-call-failed
Note: I have also tried building MonoDevelop from source on Ubuntu in WSL, but ran into this issue.
It's Bugging Since The First Bionics in wsl. But the temporary to pass this problems is using apt-key add instead adv options through wget or curl : curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF" | sudo apt-key add
Thanks. I did get it installed via your workaround. Sadly MonoDevelop will not run though.
I hate to look a 'closed' gift horse in the mouth, but this one merits some further attention because it will keep coming up until we have a work-around on the books for the dirmngr fail proper. The problem is unrelated to Mono or MonoDevelop, natch. MariaDB (key 0xF1656F24C74CD1D8) fails the same, as will every apt-key howto anyone has ever posted on the Interwebs.
The problem is that dirmngr (sudo apt install dirnmgr) isn't running (or isn't autolaunched?) and thus there is nothing on the other end for apt-key via gpg to talk to. After around half an hour of investigation, like @sirredbeard, I wasn't able to make dirmngr at home on WSL manually. Maybe someone else will have better luck or suggestions.
I support re-opening for the wider issue with dirmgr.
I think I was able to import the key by curling it in and piping it to apt-key.
Is this only on Ubuntu and only 18.04? If so, should we file a bug report upstream with Canonical?
I think I was able to import the key by curling it in and piping it to apt-key.
Yes that's effectively the work-around until the base cause and a solution to the root problem is articulated.
Is this only on Ubuntu and only 18.04?
That is part of what merits investigation. It wasn't a problem on 16.04 (but you already knew that). Whether it wasn't a problem in 16.04 because (a) an operable dirmngr wasn't previously a requirement or (b) dirmng was working fine and nobody thought anything of it or (c) something changed with gpg or apt-key or dirmngr or something in between that now causes the sequence to fail, I can't tell you. Or at least, not with any authority after looking at it for a short bit.
but sometimes in metapackages with ubuntu-desktop when i was want to install Crystal Language by importing their gpg and it's works through the adv options
I'd like to report that any debian based distro (possibly any distro) utilizing an updated dirmngr before 18.04 was officially released as LTS was recieving this error. The issue was resolved just in time for 18.04 release. So this may be a regression or something Ubuntu did to screw with it.
When I had experienced this error utilizing Debian Buster, I simply reinstalled Debian from the Store after 18.04 was released and the updated package containing the fix was imported when upgrading from Stretch to Buster. As of yesterday evening, I have yet to see this issue re-occur.
The work-around mentioned above failed at the time and did prevent any package (including stock) from successfully upgrading. Even apt update failed.
I would recommend others test a different distro other than Ubuntu 18.04 that uses the same version of dirmngr (or upgrade to it if not part of the base) and see if it still has an issue.
For completeness, I'm running build 17134 with the latest patch.
@Alternate-Egoist
I wanted to do the same but could not duplicate your success.
I tried following the guide here https://downloads.mariadb.org/mariadb/repositories/#mirror=utm&distro=Ubuntu&distro_release=bionic--ubuntu_bionic&version=10.3
while running this, sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8, i got gpg: connecting dirmngr at '/tmp/apt-key-gpghome.cROhJELJ0N/S.dirmngr' failed: IPC connect call failed message too
I tried following the guide here ... apt-key etc etc etc ..../mariadb/.... etc etc etc ... 0xF1656F24C74CD1D8 .... I got .... etc etc .... IPC connect call failed
Well, yes. Because Quoth:
The problem is unrelated to Mono or MonoDevelop, natch. MariaDB (key 0xF1656F24C74CD1D8) fails the same, as will every apt-key howto anyone has ever posted on the Interwebs.
same error while installing mongodb
Same problem here with MariaDB, if you really need the repository you could "avoid" authenticating the repository key using sudo apt-get --allow-insecure-repositories update, after add-apt-repository.
Still it is not a proper solution, not to mention the potential security issues that could arise.
Can try this:
- use
sudo apt updatethen will get something likeThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116 - Got the pubkey
5523BAEEB01FA116 - Use
curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x5523BAEEB01FA116" | sudo apt-key addReplace 0x5523BAEEB01FA116 with 0x<your pubkey in 2step> - complete, you can run
sudo apt udpateno error
@foxliu solution seems to work just fine. But still I wasn't able to download the public key using curl, so I copied manually the key from the Ubuntu Keyserver link,to a new file in WSL, then loaded it with sudo apt-key add.
For future reference, this is the MariaDB Package Signing Key: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF1656F24C74CD1D8
i have the same error while installing mongodb
Hi. I am trying to install mongodb on Ubuntu 18.04 for Windows and got the same error: $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
Executing: /tmp/apt-key-gpghome.oRreNqzIoe/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.oRreNqzIoe/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr
I have installed mongodb many times in different Linux distros and this is the first time I see this error.
For future reference, manual solution is this: $ curl -sL "https://www.mongodb.org/static/pgp/server-4.0.asc?_ga=2.264892495.1953852568.1531143056-750073170.1531143056" | sudo apt-key add
I took a look at this today and have determined that this is a timing-related issue that is exposed because of a difference in how Windows and Linux handles connection attempts to localhost sockets. On Linux an attempt to connect to a localhost tcp socket on a port that is not active will return a failure immediately. On Windows there appears to be a 1 second timeout. This causes the following sequence to occur.
- gpg spawns dirmngr
- dirmngr attempt to connect to localhost port 9050 (this is attempted twice).
- gpg attempts to connect to a unix socket that dirmngr creates after the localhost socket connection fails.
This one second timeout in step 2 is enough to cause gpg to think that dirmngr is not responding. There appears to be a retry loop in gpg, but it is not waiting long enough to account for the 1 second connect timeout (the connect is actually attempted twice).
I've reached out to some Windows networking experts to determine if there is a way that this timeout can be avoided.
That's awesome Ben. Thank-you for digging; by total chance I was going to dive this one myself this evening. Motivation being, this is blocking LXC, which uses gpg to fetch keys for the images in the same manner as apt-key 😉.
Being ahead of me, if you've got a suggestion for a temporary work-around in the gpg or dirmngr source to make them collectively happy (avoid the timeout) that would be helpful. Even if not, at least I know where to look now, which is very appreciated. If this is going to be a long lead time thing (won't make fall release) maybe I can push a PPA to launchpad.
I haven't looked through the gpg source but it seems to be after it has launched dirmngr and is trying to connect to a unix socket it expects dirmngr to create. There is a retry loop that goes for about 20 iterations.