This is the error: stderr: Host key verification failed. fatal: Could not read from remote repository.
You need to SSH to the node and become whatever the Jenkins user running the build on the node. You can try git clone the repo as that user and accept host key or you can add this to the $HOME/.ssh/config ($HOME refers to the home directory of the Jenkins user): Host codebasehq.com StrictHostKeyChecking no Hostname codebasehq.com User <user-name-optional-to-use-other-user-credential-to-clone> IdentityFile <optional-specify-path-to-the-ssh-private-key-file-of-the-user-name> From: <[email protected]<mailto:[email protected]>> on behalf of Neil Stoker <[email protected]<mailto:[email protected]>> Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Date: Tuesday, November 1, 2016 at 8:51 AM To: Jenkins Users <[email protected]<mailto:[email protected]>> Subject: ERROR fetching remote repo 'origin' from codebasehq Hi, I am going round in circles trying to track down what is causing Jenkins giving the following error: Startedby user neils Building remotely on Project_BA(project)in workspace c:\BuildAgent\workspace\Project_BA QA Test1 > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url [email protected]:company/project/repo.git # > timeout=10 Fetching upstream changes from [email protected]:company/project/repo.git > git --version # timeout=10 using GIT_ASKPASS to set credentials > git fetch --tags --progress [email protected]:company/project/repo.git > +refs/heads/*:refs/remotes/origin/* ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from [email protected]<mailto:[email protected]>:company/project/repo.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1051) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1720) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress [email protected]<mailto:[email protected]>:company/project/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository. When using the Jenkins CI credentials I get the expected jenkins@sgpjenkins:~/tmp/palintestvero$ git fetch --tags --progress [email protected]:company/project/repo.git + refs/heads/*:refs/remotes/origin/* >From codebasehq.com:company/project/repo * branch HEAD -> FETCH_HEAD I can also successfully pull projects from the codebasehq servers. I must be missing something really obvious, but can't spot what. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/75e3f384-9cf1-411b-ab01-8eaf3d38de9b%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/75e3f384-9cf1-411b-ab01-8eaf3d38de9b%40googlegroups.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/D43E13DC.5F3AA%25ingunawa%40cisco.com. For more options, visit https://groups.google.com/d/optout.
