Unable to start Bitbucket Server, with message function: not found

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 appears in the command line:

1 2 3 4 5 #sh start-bitbucket.sh start-bitbucket.sh: 3: start-bitbucket.sh: function: not found start-bitbucket.sh: 4: [: unexpected operator start-bitbucket.sh: 7: start-bitbucket.sh: Syntax error: "}" unexpected

Cause

When you type sh start-bitbucket.sh you are probably using dash or some other shell script that does not recognize the command function.

This could be checked by issuing:

1 2 3 $ which sh $ ls -ltra <path/to/sh/returned/above>

Resolution

  • Use the script without sh or call bash start-bitbucket.sh instead, you should get it working as it will use bash in your environment.

Updated on April 7, 2025

Still need help?

The Atlassian Community is here for you.