Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69928

gitUsernamePassword does not provide "Manually provided" SSH host key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-client-plugin
    • None

      I wonder how gitUsernamePassword is supposed to work with the "Manually provided keys" verification strategy. I have a pipeline stage similar to:

      steps {
          unstash 'some-artifact'
      
          sh """
          git checkout --detach
          git add -f .
          git commit -m 'Commit Artifact'
          git tag -f '$tagName'
          """
          withCredentials([gitUsernamePassword(credentialsId: '*********', gitToolName: 'default')]) {
              sh "git push -f origin 'refs/tags/$tagName:refs/tags/$tagName'"
          }
      }
      

      The Host Key Verification Strategy is set to Manually provided keys, and the stage fails with:

      + git push -f origin refs/tags/artifact-v1.2.3:refs/tags/artifact-v1.2.3
      Host key verification failed.
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights and the repository exists.
      

      The pipeline uses the default checkout from the same repo, which succeeds.

            markwaite Mark Waite
            yoerg Yoerg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: