"Could not read loose ref" error thrown while performing Git operations on Bitbucket server

お困りですか?

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

コミュニティに質問

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

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

While accessing a Bitbucket repository via the command line, like doing a push, fetch or clone, you see the error message: "An error occurred while executing an external process: Could not read loose ref <branch name>"

診断

The atlassian-bitbucket.log will have the following error stack trace:

YYYY-MM-DD 14:45:46,372 ERROR [http-nio-8443-exec-4] username @1B4B8Y0x885x142743x0 uk4dsd XX.XX.XX.XX,XX.XX.XX.XX "GET /projects/KD/repos/perh-his-conf/browse/perh/config/PERH.Ester.Service.Epikriis2/PERH.Ester.Service.Epikriis2.exe.config HTTP/1.1" c.a.s.i.w.HandlerExceptionResolverImpl An error occurred while executing an external process: Could not read loose ref refs/heads/feature/IMU-403-logida-graylogi-http-status-500-vead-live
com.atlassian.bitbucket.ServerException: An error occurred while executing an external process: Could not read loose ref refs/heads/feature/IMU-403-logida-graylogi-http-status-500-vead-live
	at com.atlassian.stash.internal.scm.git.command.refdb.AbstractGitRefDbCommand.call(AbstractGitRefDbCommand.java:54)
	at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84)
	at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)
	at java.lang.Thread.run(Thread.java:748)
	... 342 frames trimmed
Caused by: java.io.UncheckedIOException: Could not read loose ref refs/heads/feature/IMU-403-logida-graylogi-http-status-500-vead-live
	at com.atlassian.stash.internal.scm.git.ref.LooseRefDb.retryingRead(LooseRefDb.java:154)
	at com.atlassian.stash.internal.scm.git.ref.LooseRefDb.readRef(LooseRefDb.java:406)
	at com.atlassian.stash.internal.scm.git.command.refdb.AbstractGitRefDbCommand.call(AbstractGitRefDbCommand.java:51)
	... 44 common frames omitted
Caused by: java.io.IOException: <BITBUCKET_HOME>/shared/data/repositories/74/refs/heads/feature/IMU-403-logida-graylogi-http-status-500-vead-live does not contain a hash or a symbolic ref
	at com.atlassian.stash.internal.scm.git.ref.LooseRefDb.lambda$readRef$16(LooseRefDb.java:410)
	at com.atlassian.stash.internal.scm.git.ref.LooseRefDb.retryingRead(LooseRefDb.java:149)
	... 52 common frames omitted

In your local Git client, running a git pull to get the latest data from the repository would return this:

fatal: remote error: upload-pack: not our ref 0000000000000000000000000000000000000000

原因

This occurs if any of the referenced files are empty and/or the referenced object cannot be found or read which causes corruption.

ソリューション

  • To resolve this, you will either need to update the file or find and replace the corrupted object.
  • Removing the file in question from the server can also solve the issue.

(info) Please ensure to take a backup of changes before correcting them just so you can have a record.


最終更新日 2023 年 8 月 8 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.