添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
幸福的柳树  ·  Git@gitlab.com: ...·  1 周前    · 
成熟的单杠  ·  Git's database ...·  3 天前    · 
帅呆的板凳  ·  Git pack-objects ...·  3 天前    · 
机灵的莲藕  ·  DevOps - Git ...·  3 天前    · 
热心肠的莲藕  ·  愚行录_百度百科·  4 月前    · 
紧张的树叶  ·  Java AES-256-CBC ...·  1 年前    · 
很酷的鸡蛋  ·  HttpMessageNotWritable ...·  1 年前    · 
好帅的抽屉  ·  Gather device IDs | ...·  1 年前    · 

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms .

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

Problem

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

The following appears in the atlassian-bitbucket.log

ERROR [http-nio-7990-exec-52] <username> @1WU14K3x805x122891x1 193.39.66.214 "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 193.39.66.214 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.

Cause

There may be several causes for this problem:

Cause #1 - Corrupted Git repository due to filesystem corrupton

The repository has become corrupted as a consequence of a file system corruption.

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


Cause #2 - Corrupted Git repository due to insufficient memory

The repository has become corrupted after a repack operation failed due to insufficient memory. Attempting a manual repack of the repository (see Workaround for Cause #1) shows the following error.


Workaround

If the steps below 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.

Cause #1

Manually repack the repository.

  • 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:

  • Start Bitbucket Server


Cause #2

Set a limit for the memory allocated when running the repack.

  • 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.
  • Navigate to the $BITBUCKET_HOME/shared/data/repositories/<repository_id> path.

  • Add --window-memory=<n> to the git repack command and see if adjusting the value produces a different output and allows the repack to complete successfully.
git fsck --no-dangling 
git repack -adfln --keep-unreachable --depth=20 --window=200 --window-memory=500m
git repack -adfln --keep-unreachable --depth=20 --window=200 --window-memory=1g
  • Start Bitbucket Server


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