fatal: Reference has invalid format

お困りですか?

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

コミュニティに質問

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

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.

*Fisheye および Crucible は除く

問題

Opening a repository and/or changing the visualization to another branch within Bitbucket Server throws the following error in the UI:

'C:\Program Files (x86)\Git\cmd\git.exe for-each-ref --sort=-creatordate
 --format=%(refname)%02%(objectname)%02%(*objectname) refs/tags/' exited
 with code 128 saying: fatal: Reference has invalid format: 
'refs/heads/master (1)'

The following appears in the atlassian-bitbucket.log

2016-07-27 10:00:00,000 ERROR [http-nio-7990-exec-8] user @10ETR3Gx632x493x0 127.0.0.1 "GET /scm/project/repo.git/info/refs HTTP/1.1" c.a.s.i.s.g.p.h.GitSmartExitHandler Request for repo 'repo' of project 'project' from '127.0.0.1' failed: read process 'C:\Program Files (x86)\Git\cmd\git.exe http-backend' caused an exception
Process's error output: fatal: Reference has invalid format: 'refs/heads/master (1)'

診断

Diagnostic Steps

  1. Find this repository's location on disk in the server in the repository's Settings > Repository Details.
  2. Access the server hosting Bitbucket Server and navigate into the repository's location on disk.
  3. Access the directory refs/heads and confirm you have duplicated entries for your refs, being one the original and another one of the " (1)" appended.

原因

Something in the file system caused the entries in the refs directory to get duplicated - copies are created with an inconsistent and invalid name, with the convention of having, for instance, " (1)" or " - copy" by the end of their name.

ソリューション

ソリューション 1

As it's hard to ensure the repository is consistent after this occurrence, you should ideally restore your instance from the most recent backup you have, making sure you have saved any recent work done after the backup was taken, so you can re-add it.

ソリューション 2

The files with " (1)" appended should be merely copies of the originals, so it should be safe to:

  1. Create a full backup of your Bitbucket Server instance.
  2. Stop Bitbucket Server.
  3. Remove the duplicated files.
  4. Start Bitbucket Server.

 

 

 

最終更新日 2016 年 8 月 29 日

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

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