You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Committing after latest update (2.5.7) results in cryptic error from embedded git #11015
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
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
Logs
Logs are attached (with personal info redacted) showing the actual output of the message:
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).
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?
@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.
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
using #!/bin/bash
Follow up: This occurs with an empty script (using bash shebang), so it's not an exit code thing:
@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.
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.
Activity
niik commentedon Nov 12, 2020
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?
aphix commentedon Nov 12, 2020
@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 addstep. I can see that viagit statusin a shell after attempting to commit via GitHub Desktop and receiving the error modal mentioned in the bug report above.aphix commentedon Nov 12, 2020
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/bashshebang results in the error above (again, was working before), whereas using#!/bin/shappears to be working as expected (the message echoed from the script is in the error modal.Screenshots:
using

#!/bin/shusing

#!/bin/bashFollow up: This occurs with an empty script (using bash shebang), so it's not an exit code thing:

aphix commentedon Nov 12, 2020
@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 abash.exethat 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.
aphix commentedon Nov 12, 2020
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.
steveward commentedon Nov 12, 2020
@aphix thanks for sharing your debugging steps! I'm glad to hear you were able to get things resolved.