Skip to content

switching branch triggers an error #4938

Closed

Description

@leonsegal

Every time I switch to another branch using 'cmd + b' within a local repo, I get the following error modal:

A lock file already exists in the repository, which blocks this operation from completing.

I am using a mbp with high sierra 10.13.5 and github desktop 1.2.3

The error can be dismissed without consequence, I just thought you might want to know about it.

The error does not appear when changing branches with point and click in the menus.

I have looked this error up and various sources suggest creating a lock file, then deleting it, but this did not fix the error.

Leon

Activity

  1. steveward commented on Jun 14, 2018

    @steveward
    Contributor

    Thanks for opening this @leonsegal. Could you upload a log file so we can take a closer look at what the issue might be?

    macOS logs location: ~/Library/Application Support/GitHub Desktop/logs/*.desktop.production.log

    You can also access the log files by going to the file menu in GitHub Desktop and selecting Help > Show Logs in Finder. Please upload a log file from a day where you experienced this error.

  2. added
    more-info-needed
    on Jun 14, 2018
  3. leonsegal commented on Jun 14, 2018

    @leonsegal
    Author

    Log:

    2018-06-14T15:51:00.018Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: brand-iq - leonsegal (has token)
    2018-06-14T15:51:00.019Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: brand-iq - leonsegal (has token)
    2018-06-14T15:51:00.048Z - error: [ui] `git -c credential.helper= checkout --progress master --` exited with an unexpected code: 128.
    fatal: Unable to create '/Users/leon/Sites/brand-iq/.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.
    
    (The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
    

    I don't have a terminal window open anywhere, so I don't think there is another git process running (at least not one I have initiated).

    Also, there is no index.lock in the .git dir.

  4. shiftkey commented on Jun 15, 2018

    @shiftkey
    Member

    I don't have a terminal window open anywhere, so I don't think there is another git process running (at least not one I have initiated).

    @leonsegal this error occurs when a Git operation that needs to touch the index of the repository encounters an existing operation that is currently modifying the index - so the second operation fails.

    This occasionally happens when multiple tools are trying to work with the same repository - are you using another tool alongside Desktop that also has Git integration?

  5. leonsegal commented on Jun 15, 2018

    @leonsegal
    Author

    No, this is the weird thing (and why I posted it).

    I do use phpstorm, which has git integration, but this a new bug since a recent update.

    I will investigate if it is phpstorm causing the error.

    UPDATE
    This bug still appears even when phpstorm is closed.

  6. shiftkey commented on Jul 6, 2018

    @shiftkey
    Member

    Every time I switch to another branch using 'cmd + b' within a local repo, I get the following error modal:

    This seems to be something fairly easy to reproduce, particularly if it's happening without WebStorm running.

  7. added
    investigation-needed
    and removed
    more-info-needed
    on Jul 6, 2018
  8. leonsegal commented on Jul 9, 2018

    @leonsegal
    Author

    screen shot 2018-07-09 at 08 40 37
    I am new to this - did you want me to reproduce it? Am I the reviewer?

    Should I take a screen shot?

  9. paulrehkugler commented on Aug 8, 2018

    @paulrehkugler

    I also get this error frequently when clicking on the “open this in GitHub Desktop” link, when switching branches locally works just fine. Here’s the relevant log:

    2018-08-08T15:56:58.790Z - error: [ui] `git -c credential.helper= checkout --progress **redacted** --` exited with an unexpected code: 128.
    fatal: Unable to create '/Users/rehkugler/Documents/Development/**redacted**/.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.
    
    (The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
    

    I’m unsure if this is related, but the error dialog also appears twice (i.e. when I click “Close” it immediately reappears. Clicking “Close” on the second dialog closes the error permanently)

  10. added
    bug
    and removed
    investigation-needed
    on Aug 8, 2018
  11. added this to the 1.3.x milestone on Aug 8, 2018
  12. 12 remaining items

  13. modified the milestones: 1.3.5, 1.4.0 on Aug 31, 2018
  14. removed this from the 1.4.0 milestone on Sep 5, 2018
  15. removed their assignment
    on Sep 14, 2018
  16. added
    priority-2
    on Oct 11, 2018
  17. self-assigned this
    on Oct 25, 2018
  18. removed their assignment
    on Nov 9, 2018
  19. shiftkey commented on Nov 9, 2018

    @shiftkey
    Member

    I believe this will be resolved with #5952 which enables --no-optional-locks for all users and will be available with 1.5.0 next week.

    If someone is still able to trigger this on that version, I'd love an updated log or set of reproduction steps.

  20. wanda-madikana-sage commented on May 19, 2021

    @wanda-madikana-sage

    Make sure your application is not running

  21. leonsegal commented on Aug 10, 2021

    @leonsegal
    Author

    Make sure your application is not running

    Sorry, which application do you mean? l think this issue is closed now.

  22. ashpimm88 commented on Sep 27, 2022

    @ashpimm88

    Hi I not long ago started using this and I have been making a heap of change to our project an now when I go to commit it says the same message about a lock file already existing. I don't even know what that is lol any help please?!

  23. LesnierM commented on Jan 10, 2023

    @LesnierM

    I have the same error.

  24. ghero56 commented on Nov 18, 2024

    @ghero56

    Me too

  25. aqibcyb12 commented on Jan 23, 2025

    @aqibcyb12

    goto the folder .git in your explorer , a file name index.lock is available just delete and commit again , cheers folk😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions