Bitbucket Server fails to start on Windows with error "IllegalStateException: Could not find GNU bash; hook scripts will not work"

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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:

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 variable
      or
      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.

Description
Bitbucket fails to start on Windows. Log shows error "IllegalStateException: Could not find GNU bash; hook scripts will not work".
ProductBitbucket Server

Last modified on Sep 27, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.