Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-17264

Host key verification failed when retrieving submodule

    XMLWordPrintable

    Details

      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

      1. Configure Bitbucket Server repository with submodules
      2. Add repository to Linked Repositories in Bamboo
      3. 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

      1. 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

      2. 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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jgiles@atlassian.com James Giles IV (Inactive)
              Votes:
              31 Vote for this issue
              Watchers:
              36 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: