The Behind/Ahead column within the branches option in Bitbucket shows "Not Available"

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

Summary

Navigating to branches in a repository the Behind/Ahead information shows "Not available"

(Auto-migrated image: description temporarily unavailable)

Environment

Bitbucket Data Center / Server

Git 2.23 or lower

Diagnosis

The following entry is found in the logs for the repository where the issue is observed

1 2021-03-01 14:55:12,301 INFO [http-nio-7990-exec-186] user *JCWIL46x295x210528x6 117q9an 127.0.0.1,127.0.0.1 "GET /rest/api/latest/projects/dgtp/repos/another-git-in-the-wall/branches HTTP/1.1" c.a.s.i.r.PluginRefMetadataMapProvider Timed out when retrieving ref metadata for com.atlassian.bitbucket.server.bitbucket-branch:ahead-behind-metadata-provider

Cause

Bitbucket has a 2-seconds timeout set as default for fetching metadata information from repository references, and in some cases depending on the size of the references, it can time out the Behind/ahead request from getting any information.

Solution

  1. Increase metadata timeout

  • Edit <BITBUCKET_HOME>/shared/bitbucket.properties and add following property:

    1 ref.metadata.timeout=5

    ℹ️ If 5 seconds does not solve it, you may need to increase it even further.

  • Restart Bitbucket;

2. Update Git to 2.24

  • Git 2.24 comes with git commit graph enabled by default and this helps in making behind/ahead requests faster. Do note that Git 2.24 is supported in Bitbucket 6.8 version onwards.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.