Git commit agent socket error

Hello! I’ve started getting this error when I try to git commit:

error: Couldn't get agent socket?

fatal: failed to write commit object

I’ve tried rebooting, reinstalling git and ssh and openssh, changing my signing key, and running the command straight on a TTY without a window manager. The only match for the error I can find is related to Bitwarden, which I don’t have installed. I can’t think of what has changed since the last time I made a git commit, but it hasn’t been more than a day or two.

Is your ssh-agent running?

Apparently it wasn’t. I used https://wiki.nixos.org/wiki/SSH_public_key_authentication#SSH_agent to figure out I wanted services.ssh-agent.enable in my home manager, and then to use ssh-add to add the relevant key. I have no idea how I was successfully signing commits and sshing around without needing to identify before, but it has stopped working. Hopefully this helps leave breadcrumbs for this error for anyone else in my situation.

1 Like