git upload-archive archiver died with error

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

When using 'git archive' from a remote machine to Bitbucket Server as shown below only works with tags or HEAD, but not the commit id.

1 2 3 4 $ git archive -o testing.tar --remote=ssh://git@<server>:7999/<project>/testing.git --format=tar 3a8de704c0da882cf8ddc1fecda4621062c48870 fatal: sent error to the client: git upload-archive: archiver died with error remote: fatal: no such ref: 3a8de704c0da882cf8ddc1fecda4621062c48870 remote: git upload-archive: archiver died with error

Cause

According to Git 1.7.8.1 release notes:

1 "git archive" mistakenly allowed remote clients to ask for commits that are not at the tip of any ref.

Resolution

This is an expected behaviour for the newest versions of Git.  Remote Git repositories do not allow clients to access arbitrary SHA1s. The requested objects should be accessed by a ref (i.e. file name).

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.