问题开始于我无法签署我的Git提交。
$ git commit --verbose -S -sam "Attempt to sign commit"
gpg: invalid size of lockfile 'C:\Users\username\.gnupg/gnupg_spawn_agent_sentinel.lock'
gpg: cannot read lockfile
gpg: can't connect to the agent: Invalid argument
gpg: keydb_search failed: No agent running
gpg: skipped "KEY_ID_ABC123": No agent running
gpg: signing failed: No agent running
error: gpg failed to sign the data
fatal: failed to write commit object
我似乎无法签名,因为GPG代理没有运行,而代理没有运行是因为gnupg_spawn_agent_sentinel.lock
的锁定文件大小无效。
运行gpg -K
也会出现类似的错误:
$ gpg -K
gpg: invalid size of lockfile 'C:\Users\username\.gnupg/gnupg_spawn_agent_sentinel.lock'
gpg: cannot read lockfile
gpg: can't connect to the agent: Invalid argument
我检查了~/.gnupg/gnupg_spawn_agent_sentinel.lock
的文件大小
$ ll ~/.gnupg/ | grep gnupg_spawn_agent_sentinel
-rw-r--r-- 1 username 1049089 0 Dec 16 16:53 gnupg_spawn_agent_sentinel.lock
它显示gnupg_spawn_agent_sentinel.lock
是0字节!回家了吗?我该如何从这里继续解决这个错误呢?
1条答案
按热度按时间ddrv8njm1#
显然删除损坏的
.lock
文件解决了我的问题。如果有人能详细说明锁文件的用途,以及此解决方案的副作用(如果有的话),我将不胜感激。