Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.10.0, 5.10.1.1
-
Severity 2 - Major
-
1
-
Description
Summary
When checking out submodules Bamboo receives a Host key verification failed error like below
Submodule 'Bools/BoolCommon' (ssh://de35af7f-7f53-4023-cbe3-93fe9415b6a3@127.0.0.1:55298/bools/bool-common.git) registered for path 'Bools/BoolCommon' Cloning into 'Applications/PATT/Tests/Data'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Steps to Reproduce
- Configure Bitbucket Server repository with submodules
- Add repository to Linked Repositories in Bamboo
- Configure Bamboo plan to checkout repository
Expected Results
Bamboo checks out submodules without issue
Actual Results
The below exception is thrown in the build log file:
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Notes
- Git submodule command accesses local ssh proxy checking fingerprint of server.
- Bamboo is using generated ssh key for main repository, not the one for the submodule
Workaround
- Add to ~/.ssh/config two lines to ignore fingerprint when connecting to localhost.
Host localhost StrictHostKeyChecking no Host 127.0.0.1 StrictHostKeyChecking no
If the modification above is successful, the proxy will be able to connect to Bitbucket Server (fka Stash) to subsequently run the submodule command.
OR - Run Git Clone command for the submodule repository manually to verify the host key
Note
When you use submodule with global path, git will bypass the on-demand, intermediary, locally created SSH proxy that it normally uses to connect to the repo, and connect to it directly. This requires that the SSH key must be available at the OS level. However, when your submodule uses a relative path, git will interface with it via the proxy similarly to how it connects to the parent repository. For this reason, it might be necessary to duplicate and copy the auto-generated, public SSH access key of the parent repository to the Access Keys of each related submodule repo.
Reference: Identify which project or repository a SSH key is associated with