kynan / nbstripout

strip output from Jupyter and IPython notebooks
Other
1.21k stars 96 forks source link

'fatal: Unable to create '.../.git/index.lock': File exists. #103

Closed patricksheehan closed 5 years ago

patricksheehan commented 5 years ago

When running nbstripout via pre-commit I get the following error:

Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. fatal: Unable to create 'REPO_PATH/.git/index.lock': File exists.

Has anyone run into this? I've tried wiping my pre-commit installation, wiping the local repo, etc.

kynan commented 5 years ago

Is this reproducible? Did you confirm you don't actually have any other process running that might try to modify the git index as the error message suggests?

patricksheehan commented 5 years ago

Yeah it's quite confusing to me. I've tried:

patricksheehan commented 5 years ago

One more detail is that the command-line version does work as intended

patricksheehan commented 5 years ago

Ok this seems to have resolved itself while I was doing some other things. Not sure what the state was that caused it, but I'll close this out!

SimonBiggs commented 5 years ago

Interestingly, I am getting this error when running nbstripout within pre-commit on GitHub actions:

https://github.com/pymedphys/pymedphys/pull/486/checks?check_run_id=232417630#step:4:64

Based on the following action:

https://github.com/pymedphys/pymedphys/blob/4a9d63ad6859e8d31ee2e3f277932233f8a69fcb/.github/workflows/main.yml#L5-L19

I tried doing a quick and dirty rm -fv .git/index.lock before running pre-commit but it didn't help...

kynan commented 5 years ago

@SimonBiggs have you had a chance to investigate further?