question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git index.lock file exists | --root-changelog not working

See original GitHub issue

I believe this is a 2-part issue.

Our project contains 1000+ libraries. When I run nx run workspace:version, the semver plugin starts generating CHANGELOG.md files for every library. At some point it stops with the following error:

Error: Command failed: git add /Users/crash/git/iko-travel-spa/libs/shared/ui-date-time-picker-form/CHANGELOG.md
fatal: Unable to create '/Users/crash/git/iko-travel-spa/.git/index.lock': File exists.

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.

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Socket.<anonymous> (internal/child_process.js:444:11)
    at Socket.emit (events.js:314:20)
    at Pipe.<anonymous> (net.js:675:12)

I am not running any other process of Git.

The second part of this issue is that, according to your documentation, it should just create / update a single CHANGELOG.md file located in project root. I’ve tried updating the call by including:

nx run workspace:version --root-changelog=true

with no success.

I think there is definitely an error happening when there are too many projects and the lock file wasn’t removed fast enough between change log generations. But this error is caused by the fact that the plugin should be generating only one change log but instead generates 1K+, in the case of my project.

Please let me know if I can provide you with anything else.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bjornharvoldcommented, Apr 14, 2021

Perfect!! That will fix the Nx cache invalidation as well here: #149

1reaction
edbzncommented, Apr 9, 2021

@bjornharvold I just opened a PR related to your comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

990 - Stack Overflow
git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier ...
Read more >
Git - How to Solve `'git/index.lock': File exists` Error in ...
While I was working on this blog, I faced with that error several times. In this post, we'll look into a quick hacky...
Read more >
Understanding and Using Git's index.lock File | Pluralsight
The index.lock file prevents changes to your local repository from happening from outside of the currently running git process so as to ensure ......
Read more >
Bitbucket Support - Atlassian Documentation
When doing a local git write, like a git merge, you see the following error: fatal: Unable to create '<path>/.git/index.lock': File exists. Make ......
Read more >
Visual Studio creating index.lock files, cannot use git clients ...
error: Unable to create 'C:/Repos/CFE/.git/index.lock': File exists. ... As soon as I close Visual Studio I can complete the git operation with no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found