500 error when performing a Git operation against a Bitbucket Server repository

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

Problem

Performing any Git operation against a Bitbucket Server repository fails, and a 500 error message is returned.

The following appears in the atlassian-bitbucket.log:

1 2 3 ERROR [http-nio-7990-exec-4] @BZM30Fx890x69x0 127.0.0.0 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/scm/<project_key>/<repository_slug>.git/info/refs] java.lang.IllegalArgumentException: [/var/atlassian/application-data/bitbucket/shared/data/repositories/<repositoryId>] does not exist at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]

Diagnosis

Diagnostic Steps

  • Browse to the location specified in the log files (/var/atlassian/application-data/bitbucket/shared/data/repositories/<repositoryId>) and check if the folder exist and is not empty

  • Alternatively, browse to the

    1 <BITBUCKET_URL>/projects/<project_key>/repos/<repository_slug>/settings

    page and click on "Approximate size". The "Location on disk" on the user interface shows the same path reported in the log files.

The folder is expected to be empty or missing, and the "Approximate size" check returns 0KB.

Cause

The repository folder has been removed or emptied.

Solution

Resolution

Restore a previous backup of Bitbucket Server by using the Bitbucket Server Backup Client.

A complete restore is the optimal solution. In case you don't have a backup available, you could restore the single repository folder from an existing partial backup.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.