Git operations fail due to "git-pack-objects died with error"


アトラシアン コミュニティをご利用ください。


プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。


Git commands don't complete successfully.

The following appears in the command console output:

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error

atlassian-bitbucket.log に次のメッセージが出力される。

ERROR [http-nio-7990-exec-52] <username> @1WU14K3x805x122891x1 "POST /scm/<project_key>/<repository_slug>.git/git-upload-pack HTTP/1.1" c.a.s.i.s.g.p.h.GitSmartExitHandler <project_key>/<repository_slug>[10]: Read request from failed: com.atlassian.utils.process.ProcessException: Non-zero exit code: 1
The following was written to stderr:
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.


There may be several causes for this problem:

Cause #1 - Corrupted Git repository

The database has become corrupted (e.g. as a consequence of a filesystem corruption).

Note: cloning the repository directly on the filesystem (without using Bitbucket Server) may still succeed since a Git clone does not run any additional checks and assumes that the repository is in a consistent state.


Try to run the following commands to see if they resolve the problem:

  • Stop Bitbucket Server
  • Copy the $BITBUCKET_HOME/shared/data/repositories/<repository_id> folder. This is to make sure that a backup of the entire repository is available.
  • Run the following commands from the $BITBUCKET_HOME/shared/data/repositories/<repository_id> path:

    git fsck --no-dangling
    git repack -adfln --keep-unreachable --depth=20 --window=200
  • Start Bitbucket Server

If the steps above don't resolve the problem, the repository may be not recoverable. In this case, the situation can be resolved by restoring a backup generated prior to the corruption.

説明This article discusses about causes and workaround when git commands don't complete successfully.

最終更新日 2021 年 8 月 24 日


Powered by Confluence and Scroll Viewport.