Skip to content

Committing after latest update (2.5.7) results in cryptic error from embedded git #11015

Closed

Description

@aphix

Describe the bug

After updating to version 2.5.7, when committing a change, the embedded git throws a cryptic looking error (screenshot below).

When removing the unprintable characters, it reads:

Windows Subsystem for Linux has no installed distributions.


Distributions can be installed by visiting the Microsoft Store:


https://aka.ms/wslstore

Version & OS

Github Desktop 2.5.7
Windows 10 Pro version 2004 (No WSL)

Steps to reproduce the behavior

  1. Attempt to commit a change

Expected behavior

Change is committed

Actual behavior

Error is thrown by embedded git, which bubbles up to error modal (see logs & screenshot).

Screenshots

image

Logs

Logs are attached (with personal info redacted) showing the actual output of the message:

2020-11-12.desktop.production_redacted.log

Additional context

After stepping through the code using the developer tools (in Github Desktop), I discovered that the env var LOCAL_GIT_DIRECTORY can be used to bypass the embedded git. After setting it to the directory of a local git bash installation I was able to commit without an issue.

Fetching/pulling seems fine, even with embedded git (not sure about pushing), but committing fails 100% of the time now (unless the env var mentioned above is set).

I had no issue prior to version 2.5.7.

EDIT: See this comment for the latest information; it appears to be a local PATH issue (unsurprisingly).

Activity

  1. niik commented on Nov 12, 2020

    @niik
    Member

    Hey @aphix, thanks for opening this. I'm really confused as to what could be causing this. The only thing changed in 2.5.7 from 2.5.6 was that we upgraded to the latest version of Git-LFS (2.12.0) which fixed a critical security vulnerability on Windows. Is the repository you're working on using LFS?

  2. added
    more-info-needed
    windows
    on Nov 12, 2020
  3. aphix commented on Nov 12, 2020

    @aphix
    Author

    @niik Negative, we're not using LFS in any of the repos.

    I followed the changes as much as I could in dugite and I don't quite understand where it could've come from either.

    Not sure if it should matter, but I did try changing the shell options and get the same error in all cases (cmd/powershell/cygwin).

    Edit, additional info: It does appear that files/lines in the commit are staged, but not committed, so I believe it's getting past the git add step. I can see that via git status in a shell after attempting to commit via GitHub Desktop and receiving the error modal mentioned in the bug report above.

  4. removed
    more-info-needed
    on Nov 12, 2020
  5. aphix commented on Nov 12, 2020

    @aphix
    Author

    Ah! The plot thickens -- so tried a few different local repos to make sure it happened in all cases, but I got one to work, and it appears the difference is that I have a pre-commit hook (which was working previously with the app, passing any errors as expected in the modal).

    Interestingly, using the #!/bin/bash shebang results in the error above (again, was working before), whereas using #!/bin/sh appears to be working as expected (the message echoed from the script is in the error modal.

    Screenshots:

    using #!/bin/sh
    image

    using #!/bin/bash
    image

    Follow up: This occurs with an empty script (using bash shebang), so it's not an exit code thing:
    image

  6. aphix commented on Nov 12, 2020

    @aphix
    Author

    @niik Okay, I think I figured out the nature of the issue: I've reproduced the same issue in terminal by calling the embedded git directly with a PATH matching the one from the application.

    It's prefixing the PATH with the embedded git, which actually is fine (same issue when those are removed), but rather somewhere else is also prefixing, after the embedded git dirs, the system32 path (C:\Windows\System32), which happens to have a bash.exe that outputs the error in this bug report. I say "also prefixing" because it does not otherwise match the PATH I see reported in any shell or by Windows.

    I'm going to do a bit more research to see if that portion is being added by GitHub Desktop, but it appears that may not be the case. If it's coming from somewhere else then I'll close this out.

  7. aphix commented on Nov 12, 2020

    @aphix
    Author

    Looks like a local issue following some unrelated installations that have moved the windows directories to a higher precedence in my PATH. Closing this out now.

  8. steveward commented on Nov 12, 2020

    @steveward
    Contributor

    @aphix thanks for sharing your debugging steps! I'm glad to hear you were able to get things resolved.

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

    windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions