The Behind/Ahead column within the branches option in Bitbucket shows "Not Available"
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
Navigating to branches in a repository the Behind/Ahead information shows "Not available"
環境
Bitbucket Data Center / Server
Git 2.23 or lower
診断
The following entry is found in the logs for the repository where the issue is observed
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
原因
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.
ソリューション
- Increase metadata timeout
Edit <BITBUCKET_HOME>/shared/bitbucket.properties and add following property:
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.