Bitbucket could not be started due to java.nio.file.FileAlreadyExistsException
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
要約
Bitbucket is not able to start and has this error "SpringMVC dispatcher [springMvc] could not be started" in the logs.
環境
Bitbucket 7.21.4
診断
During Bitbucket startup, after it acquires lock on Bitbucket home directory, it fails to start while creating temporary files and the error below is seen in the Bitbucket logs.
2023-02-04 18:53:36,918 ERROR [spring-startup] c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher [springMvc] could not be started
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gitHookInstaller' defined in com.atlassian.stash.internal.scm.git.GitWiring$LocalWiring: Invocation of init method failed; nested exception is java.nio.file.FileAlreadyExistsException: BITBUCKET_HOME/shared/config/git/hooks/pack-objects.tmp -> /BITBUCKET_HOME/shared/config/git/hooks/tmp-xxx-pack-objects.tmp
...
Caused by: java.nio.file.FileAlreadyExistsException: BITBUCKET_HOME/shared/config/git/hooks/pack-objects.tmp -> BITBUCKET_HOME/shared/config/git/hooks/tmp-xxx-pack-objects.tmp
原因
On startup, Bitbucket acquires a lock on the home directory, creates temporary files (one among them is git hook script temp files) which are usually deleted automatically on graceful shutdown. However, these tmp files were not deleted during shutdown. During startup, Bitbucket complained that a file already exists at the specific location and failed to start.
ソリューション
Delete the BITBUCKET_HOME/shared/config/git/hooks/pack-objects.tmp file and start Bitbucket.
この内容はお役に立ちましたか?