500 errors when opening a file or the commit list when mailmap is used.

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

Problem

When the repository has a .mailmap file in its root directory, opening the commit list or a file fails with a 500 error. Additionally, the following appears in the atlassian-bitbucket.log:

  • on Linux or Mac OS:

    1 2 3 4 An error occurred while executing an external process: '/usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/master -- mailmap' exited with code 139 com.atlassian.bitbucket.exception.ServerException: An error occurred while executing an external process: '/usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/master -- mailmap' exited with code 139 at com.atlassian.bitbucket.internal.scm.git.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120) ~[na:na] at com.atlassian.bitbucket.internal.scm.git.GitCommandExitHandler.onError(GitCommandExitHandler.java:163) ~[na:na]
  • or on Windows:

    1 2 3 4 An error occurred while executing an external process: 'C:\Program Files (x86)\Git\cmd\git.exe rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/master -- .mailmap' exited with code 255 com.atlassian.bitbucket.exception.ServerException: An error occurred while executing an external process: 'C:\Program Files (x86)\Git\cmd\git.exe rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/master -- .mailmap' exited with code 255 at com.atlassian.bitbucket.internal.scm.git.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120) ~[na:na] at com.atlassian.bitbucket.internal.scm.git.GitCommandExitHandler.onError(GitCommandExitHandler.java:163) ~[na:na]

Cause

This is related to a bug in Git from 1.8.2 to 1.8.4 (on Linux or Windows), which is described in more details in BSERV-3891.

Workaround

Either:

  • to fix the issue on all the repositories hosted in Bitbucket Server, downgrade to a version of Git or msysgit prior to 1.8.2.

  • or, to fix the issue only for the current repository, edit the .mailmap on the repository's default branch (usually master) to include a newline at the end of the file, then commit and push the change to Bitbucket Server:

    1 2 3 4 5 $ git fetch origin $ git checkout origin/master $ echo -e "\n" >> .mailmap $ git commit -m"fix .mailmap line ending" -- .mailmap $ git push origin HEAD:master
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.