Bitbucket Smart Mirror repositories fail to synchronize with Bad configuration option: AddKeysToAgent

お困りですか?

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

コミュニティに質問


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

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

*Fisheye および Crucible は除く

要約

After upgrading a Bitbucket Mirror to a version => 7.9, the repositories stop synchronizing and fetching changes, even if the mirror is reported as SYNCHRONIZED.

環境

Bitbucket DC Mirror mode v.7.9+

Linux

OpenSSH < v7.2 on the mirror

診断

The following appears in the mirror logs:

xxxxxxxxx ERROR [farm-refchange-poller:thread-1] @xxxxxxx c.a.b.i.m.m.f.q.FarmRequestRetryingProcessor Request DefaultFarmQueueRequest{value=FarmSynchronizationRequest{externalRepositoryId=16, type=incremental}, attempt=6} exhausted retries (5) message: [Exception while processing an event for repository[16]:]
java.lang.RuntimeException: Unexpected error generating a list of changes
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.RefChangeCalculator.remoteDiff(RefChangeCalculator.java:138)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.FarmOrchestrator.calculateRefChanges(FarmOrchestrator.java:124)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.FarmOrchestrator.lambda$orchestrateChanges$0(FarmOrchestrator.java:96)
	at com.atlassian.bitbucket.internal.mirroring.mirror.repository.DefaultRepositoryLockCallback.onLockSuccess(DefaultRepositoryLockCallback.java:45)
	at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryLockService.performUsingLock(MirrorRepositoryLockService.java:86)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.FarmOrchestrator.orchestrateChanges(FarmOrchestrator.java:88)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.FarmQueueProcessorWiring.lambda$refChangesQueueProcessor$1(FarmQueueProcessorWiring.java:50)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.queue.FarmRequestLockRetryingProcessor.process(FarmRequestLockRetryingProcessor.java:42)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.queue.FarmRequestRetryingProcessor.process(FarmRequestRetryingProcessor.java:50)
	at com.atlassian.bitbucket.internal.mirroring.mirror.mdc.FarmRequestStateTransferringProcessor.process(FarmRequestStateTransferringProcessor.java:25)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.queue.FarmQueuePoller$QueuePollerTask.run(FarmQueuePoller.java:86)
	at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.lang.Thread.run(Thread.java:748)
	... 1 frame trimmed
Caused by: java.util.concurrent.ExecutionException: com.atlassian.bitbucket.scm.CommandFailedException: '/usr/local/git/bin/git ls-remote --refs ssh://git@<BASE_URL>/<PROJECT>/<REPO>.git' exited with code 128 saying: command-line: line 0: Bad configuration option: AddKeysToAgent
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
	at com.atlassian.bitbucket.internal.mirroring.mirror.farm.refchange.RefChangeCalculator.remoteDiff(RefChangeCalculator.java:134)
	... 16 common frames omitted
Caused by: com.atlassian.bitbucket.scm.CommandFailedException: '/usr/local/git/bin/git ls-remote --refs ssh://git@<BASE_URL>:7999/<PROJECT>/<REPO>.git' exited with code 128 saying: command-line: line 0: Bad configuration option: AddKeysToAgent
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
	at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onError(DefaultCommandExitHandler.java:47)
	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:111)
	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:208)
	at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:32)
	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.callExitHandler(NioNuProcessHandler.java:286)
	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.finish(NioNuProcessHandler.java:327)
	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.onExit(NioNuProcessHandler.java:119)
	at com.atlassian.bitbucket.internal.process.nu.LatchedNioNuProcessHandler.onExit(LatchedNioNuProcessHandler.java:38)
	at com.zaxxer.nuprocess.internal.BasePosixProcess.onExit(BasePosixProcess.java:307)
	at com.zaxxer.nuprocess.linux.ProcessEpoll.handleExit(ProcessEpoll.java:371)
	at com.zaxxer.nuprocess.linux.ProcessEpoll.cleanupProcess(ProcessEpoll.java:334)
	at com.zaxxer.nuprocess.linux.ProcessEpoll.process(ProcessEpoll.java:272)
	at com.zaxxer.nuprocess.internal.BaseEventProcessor.run(BaseEventProcessor.java:81)
	at com.zaxxer.nuprocess.linux.ProcessEpoll.run(ProcessEpoll.java:188)
	at com.zaxxer.nuprocess.linux.LinuxProcess.run(LinuxProcess.java:107)
	at com.zaxxer.nuprocess.linux.LinProcessFactory.runProcess(LinProcessFactory.java:50)
	at com.zaxxer.nuprocess.NuProcessBuilder.run(NuProcessBuilder.java:273)
	at com.atlassian.stash.internal.concurrent.StateTransferringRunnable.run(StateTransferringRunnable.java:50)
	... 3 common frames omitted
Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 128
	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.callExitHandler(NioNuProcessHandler.java:278)
	... 16 common frames omitted



原因

In Bitbucket 7.9 an option AddKeysToAgent was added to the ssh wrapper script. That option was added to OpenSSH only in version OpenSSH 7.2: OpenSSH 7.2 Release Notes

If the server hosting the Mirror is running OpenSSH < 7.2 that option is not available, causing the errors.

ソリューション

Upgrade the version of OpenSSH on the server hosting the mirror to a version > 7.2

最終更新日 2021 年 5 月 12 日

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

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