Git: Git Bash Crash on Launch. Error: could not fork child process

Created on 6 Oct 2016  路  20Comments  路  Source: git-for-windows/git

  • [x ] I was not able to find an open
    or closed issue
    matching what I'm seeing

    Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

$ git --version --build-options
git version 2.10.1.windows.1
sizeof-long: 4
machine: x86_64
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 6.1.7601]

Windows 7
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Path Option: BashOnly
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Attempting to run in Bash

When opening Git Bash I get the following error:

Error: could not fork child process: Resource temporarily unavailable (-1). DLL rebasing may be required. See 'rebaseall / rebase --help'.

When I press enter Git Bash closes. I've tried reinstalling, installing different versions, restarting, and nothing seems to help.
gitbash

bug msys2

Most helpful comment

I had the same problem and could solve it by killing all the ssh-agent.exe processes (15+) in the task manager.

All 20 comments

Could you quickly try installing Cygwin and see whether it runs?

It did not, same error. I installed Cygwin with all the defaults. At the end it did show this, which I thought was noteworthy given the issue I'm facing:
cygwin

That is what I feared. Those errors come from the MSYS2 runtime, which is itself a friendly fork of the Cygwin runtime. Meaning: whenever Cygwin updates, we update, too.

Could you try previous Git for Windows versions to see whether they demonstrate the same problem, or whether it is a regression in the newest version?

I've tried several different versions, one much older (1.9.2), a few more recent, all the same error. Just to double check, I just installed 2.9.2, same error.

Hrm. Maybe you one of those applications installed? https://cygwin.com/faq/faq.html#faq.using.bloda

Correct, this is a work computer at a large corporation with McAfee installed and I'm sure other firewalls and things of that nature. Other coworkers are not having the same issues I am strangely enough. I will escalate internally to see if I can get any assistance. This is my nightmare D: . Thank you for the information.

McAfee is not on the BLODA list, but maybe you can identify another "dubious" application (such as PowerBroker) that is running in your setup?

Luckily for me, I come into work today and it is now working. It being a work computer, some update must have been pushed that now allows it to work. Weird experience, thank you for the information and assistance though.

@hwallace90 let's close it until the day it resurfaces?

I had exactly the same error which I managed to fix. I'm adding these details in case anyone else has the same problem. It fails on one PC but is OK on two others. The only software I have installed that is on the BLODA list is Windows Defender but I tried disabling this temporarily with no change. An uninstall and reinstall also failed to solve the problem. All PCs are running Windows 10.

I managed to finally fix it by running C:\Users\USERNAME\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\post-install.bat from an elevated command prompt. It showed a couple of errors but everything seems to be working fine afterwards.

I managed to finally fix it by running C:\Users\USERNAME\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\post-install.bat from an elevated command prompt.

This seems to be GitHub Desktop rather than Git for Windows. But I'm glad you were able to get to the bottom of it.

I had the same problem and (at least temporarily) got around it by stopping two processes in the Windows Task Manager, both of which were called 'bash.exe'.

Details of how to do that: Open Windows Task Manager, go to the Processes tab, select and right click on the process you want to end and choose 'end process'.

I had the same problem and could solve it by killing all the ssh-agent.exe processes (15+) in the task manager.

I had a similar problem. My resolution was essentially the same as dpGoose, but I got a copy of post-install.bat from executing the PortableGit 7z.exe download and quickly copying post-install.bat before it got a chance to execute and delete itself. Then I edited it so that it would do its rebase on my 64-bit Git for Windows (it checks that MINGW32 folder is there, I edited it to check for MINGW64 instead). https://github.com/git-for-windows/git/issues/1200

Rebeccah

Thank you @yangshengf one of the solutions in this issue resolved my error

1523 resolved thanks to @yangshengf

Encountered this today and solved it by killing a single instance of ssh-agent that was running.

I have encountered this issue on my Windows 10 64-bit PC several times in the past two months. I am current running git version 2.18.0.windows.1 under Git Bash for Windows. Running tasklist | grep bash show two instances of bash.exe, one instance of git-bash.exe, and one instance of ssh-agent.exe.

On the title bar it says /usr/bin/bash --login -i and inside the terminal it says

Error: Could not fork child process: There are no available terminals (-1).

My shortcut to run Git Bash, calls git-bash.exe --cd-to-home
Running mingw64.exe, ming32.exe, or msys2.exe in the install directory has the same issue.
Running autorebase.bat from the install directory did not solve the problem.

So, after kill the two bash.exe processes, I am able to launch only one Git Bash terminal. Trying to launch a second Git Bash terminal results in the Error: Could not fork child process: There are no available terminals (-1).. I have one workaround by switching to another installation e.g. Git Bash SDK. Another workaround is to reboot my Windows machine, but after a week or so this problem returns.

in my case, I found this error when running a Vuejs app. (using node)

according to : https://stackoverflow.com/questions/45799650/git-bash-error-could-not-fork-child-process-there-are-no-available-terminals

I killed "node.exe" in the task manager, ( ctrl + alt + del) and it works!

I got the same issue and as few people have mentioned that they got away by killing bash.exe or ssh-agent.exe but in my case I coudln't find any of this in task manager, or maybe I'm too stupid to find them anyway if someone can explain these or any other solution which can solve this problem then it'd be a very big help and also i'm not a tech savy so keep it in mind.

Was this page helpful?
0 / 5 - 0 ratings