Bitbucket Server fails to start on Windows with error Could not find GNU bash hook scripts will not work
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The following error is reported when starting up Bitbucket Server on Windows:
1
2
3
4
5
Caused by: java.lang.IllegalStateException: Could not find GNU bash; hook scripts will not work
at com.atlassian.stash.internal.hook.script.WindowsHookScriptCommandLineFactory.lambda$findBash$0(WindowsHookScriptCommandLineFactory.java:100)
at java.util.Optional.orElseThrow(Unknown Source)
at com.atlassian.stash.internal.hook.script.WindowsHookScriptCommandLineFactory.findBash(WindowsHookScriptCommandLineFactory.java:100)
... 5 common frames omitted
Cause
This error occurs because one of these things is true:
An unsupported version of Git is installed, and GNU bash is part of "Git for Windows" installation.
Windows cannot find the bash executable in the system
PATH
.
Resolution
For cause #1: Install a supported version of Git for Windows.
For cause #2:
Make sure that the absolute paths of the git and the bash executables are found in the system
PATH
variableor
Alternatively, configure the path to the executables directly in
<BITBUCKET_HOME>\shared\bitbucket.properties
:hookscripts.path.shell=C:\absolute\path\to\bash.exe
plugin.bitbucket-git.path.executable=C:\absolute\path\to\git.exe
Make sure that the
atlbitbucket
user is listed a member of the local administrator's group.
Lastly, restart Bitbucket so that the changes are picked.
Was this helpful?