Quick Tip – Fix gpg: can’t connect to the agent: IPC connect call failed error

I was configuring GPG renderers on  and I ran into the following error while generating the PGP key (pair) that would be used to encrypt secrets before adding them their respective pillars:
gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
gpg: Key generation canceled.

Eventually, this error was being caused by a GPG agent that was already running , which my GPG command was unable to access. To fix this error kill the running agent with the following command:
kill -9 gpg-agent

Next, restart the agent with the following command:
source <(gpg-agent –daemon)

You should now be able to re-run the GPG command you’re using to generate the key-pair and connect to the curses version of pinentry to input your passphrase.

Credits

Leave a Reply

Your email address will not be published. Required fields are marked *