Skip to content

Opening repository in Git Bash results in catastrophic error #3882

Closed

Description

@gilmae

Description

Unable to open repository in Git Bash from the desktop app. Restarting the app results in the same error every time.

Version

Version: 1.0.13
OS: Windows 10.0.16299

Replication Steps

Expected behavior: Opened in Git Bash
Actual behavior: Error on the desktop app
Reproduces how often: 100%

Logs

Error: spawn where ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

Version: 1.0.13
OS: Windows 10.0.16299

Related to #3825

Activity

  1. added
    investigation-needed
    on Jan 30, 2018
  2. changed the title [-]Opening repository in Gt Bash results in catastrophic error[/-] [+]Opening repository in Git Bash results in catastrophic error[/+] on Jan 30, 2018
  3. added this to the 1.1.x milestone on Feb 8, 2018
  4. shiftkey commented on Feb 16, 2018

    @shiftkey
    Member

    @gilmae I've not had a chance to look into this due to #3825 being challenging to implement correctly without START, but I've published an update to the beta channel which catches this error and adds some better tracing around launching shells.

    If you're able to open this up, trigger the error and look at the logs there should be some more detail about how your setup differs to mine.

    If you don't have time to switch, this will land in the stable channel next week.

  5. gilmae commented on Feb 18, 2018

    @gilmae
    Author

    2018-02-18.desktop.beta.log

    Log attached from trying to open a repo in Git Bash.

    Same results as described in issue description.

  6. shiftkey commented on Feb 19, 2018

    @shiftkey
    Member

    @gilmae thanks for confirming the app now doesn't crash.

    I'm curious why this message isn't being logged as that would have told me what it was trying to spawn.

    We rely on Git for Windows adding a certain registry key that points to it's install location. To see what's set on your machine, you can run this command in PowerShell:

    PS C:\Users\shiftkey> Get-ItemProperty HKLM:\Software\GitForWindows
    
    CurrentVersion : 2.16.1
    InstallPath    : C:\Program Files\Git
    LibexecPath    : C:\Program Files\Git\mingw64\libexec\git-core
    PSPath         : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\GitForWindows
    PSParentPath   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software
    PSChildName    : GitForWindows
    PSDrive        : HKLM
    PSProvider     : Microsoft.PowerShell.Core\Registry
    

    In theory, the InstallPath key should point to the install directory, with git-bash.exe under that directory. We're not checking that when launching, which I think is how the ENOENT occurring.

    I've published a test build containing the tracing from in #3975 here - would you mind trying out that version? If you open the Developer Tools before walking through the steps there should be some additional tracing provided.

    On my machine the log look like this when it successfully launches Git Bash:

    2018-02-19T00:30:30.737Z - info: [ui] [AppStore] loading 5 repositories from store
    2018-02-19T00:30:31.232Z - info: [ui] launching: 1.0.14-test3 (Windows 10.0.16299)
    2018-02-19T00:30:31.232Z - info: [ui] execPath: 'C:\Users\shiftkey\AppData\Local\GitHubDesktop\app-1.0.14-test3\GitHubDesktop.exe'
    2018-02-19T00:30:43.549Z - info: [ui] launching Git Bash at path: "C:\Program Files\Git\git-bash.exe"
    

    I'm curious how your machine differs to mine when this error occurs. If git-bash.exe doesn't exist there (my best guess so far) I'd love to understand how that might have happened.

  7. gilmae commented on Feb 19, 2018

    @gilmae
    Author

    Sorry if I miscommunicated, but the application definitely still crashes when opening any shell.

  8. shiftkey commented on Feb 19, 2018

    @shiftkey
    Member

    @gilmae with the crash dialog? Could you attach a screenshot of what you see?

  9. shiftkey commented on Feb 19, 2018

    @shiftkey
    Member

    @gilmae I've had a chance to read your log file again and I see the problem:

    Error: spawn where ENOENT
    

    This isn't related to launching Git Bash, but is related to the work to resolve Git on your PATH:

    const process = spawn('where', ['git'])

    where is located at C:\Windows\System32\where.exe, so this it's the same root cause as #3825 but just manifesting elsewhere. This can be fixed independent to the root cause of correctly spawning cmd.

  10. added
    bug
    and removed
    investigation-needed
    on Feb 19, 2018
  11. gilmae commented on Feb 20, 2018

    @gilmae
    Author

    I can confirm that after manually adding "c:\windows\system32" to PATH that opening the repository in Git Bash works.

    For reference, the requested screenshot is also attached:
    image

  12. locked as resolved and limited conversation to collaborators on Jul 18, 2018
  13. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions