I am using git-scm and tried to push to a repository. Upon doing so, I was greeted with the following message:
fatal: unable to get credential storage lock: File
I've had a hard time figuring out where the lock file was.
On Linux, just use strace
, but don't forget to follow child processes with the -f
option:
strace -f -eopen git credential-store --file=~/mystore store < creds
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/dev/null", O_RDWR) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/home/g179531/.gitconfig", O_RDONLY) = 3
Process 8269 attached
[pid 8269] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
[pid 8269] open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
[pid 8269] open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
[pid 8269] open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
[pid 8269] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
[pid 8269] open("~/mystore.lock", O_RDWR|O_CREAT|O_EXCL, 0666) = -1 ENOENT (No such file or directory)
fatal: unable to get credential storage lock: No such file or directory
[pid 8269] +++ exited with 128 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=8269, si_status=128, si_utime=0, si_stime=0} ---
+++ exited with 128 ++
The last file that the program tried to open before printing the error is the lock file. In my case, it's ~/mystore.lock
.