Skip to content

Instantly share code, notes, and snippets.

@Bradford1040
Last active June 1, 2025 13:20
Show Gist options
  • Select an option

  • Save Bradford1040/656995d601c2757896c1ce862d16dc96 to your computer and use it in GitHub Desktop.

Select an option

Save Bradford1040/656995d601c2757896c1ce862d16dc96 to your computer and use it in GitHub Desktop.
GPG Issues using Kleopatra switching to GIT_BASH with commit signings on Windows 10 & 11

Kleopatra:

  • "# Warning: error reading existing file /c/Users/<USER_NAME>/.gnupg/S.gpg-agent: Operation not supported"

  • Indicates that GPG (GNU Privacy Guard) is having trouble accessing the GPG agent's socket file. This typically happens when there's a conflict between different GPG installations or when the user's environment isn't correctly configured for GPG to access the agent.

Here's a breakdown of potential causes and solutions (as it was in my case):

  1. Different GPG versions or packages:
  • You might have GPG installed through different sources (e.g., Git Bash and GnuPG4Win) and they might not be compatible or recognize each other's agent.
  1. Incorrect Permissions or Ownership:
  • The GPG agent socket file might have permissions that prevent GPG from accessing it.
  1. Existing Agent:
  • Another GPG agent session might already be running, preventing a new one from starting or accessing the socket.
  1. Environment Variable Issues:
  • The GPG_AGENT_INFO environment variable might be misconfigured, preventing GPG from finding the agent.
  1. Conflict with other software:
  • Some software, like Kleopatra or Yubikey configuration tools, might interfere with GPG's ability to access the agent.

Troubleshooting and Solutions:

  1. Check for conflicting GPG versions:
  • Identify which GPG installation is in use (e.g., through Git Bash or GnuPG4Win).
  • If you have multiple versions, try uninstalling or disabling one to see if the issue resolves.
  1. Ensure correct permissions and ownership:
  • Check the permissions of the file. S.gpg-agent or if using Git_Bash gpg-agent It should have permissions that allow your user to * access it. Verify that the user running GPG is the owner of the SS.gpg-agent file. Or if using Git_Bash gpg-agent you will see $gpg-agent[####]: gpg-agent running and available
  1. Kill existing agent sessions:
  • Use the command gpgconf --kill gpg-agent to terminate any running GPG agent sessions.
  1. Verify and set environment variables:
  • Check the value of GPG_AGENT_INFO. It should point to the correct location of the GPG agent socket file.
  • If it's incorrect or missing, set it using eval $(gpg-agent --daemon) or export GPG_AGENT_INFO=....
  1. Check for interfering software:
  • If you're using software like Yubikey configuration tools, temporarily disable them to see if the issue is related to them.
  1. Restart your machine:
  • A simple restart can sometimes resolve issues related to environment variables and process conflicts.
  1. Update GPG:
  • Consider updating your GPG installation to the latest version to potentially address any known issues.
  1. Use GPG2:
  • If you're on macOS or some Linux versions, try switching to gpg2 instead of gpg.
  1. Renew keys:
  • If your GPG key is expired, renew it or use the gpg keychain app to renew it.
  1. Create a new GPG key:
  • If the issue persists, generating a new GPG key might be necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment