I'm setting up Jenkins with GitHub. Following is what I have done so far:
- Installed Jenkins and Git on one of our Windows VM's.
- Received a common user. I am using this user for github.
- Setup ssh keys with this user and added these ssh keys to github account.
- Copied Git SSH keys to Jenkins folder also.
After all above when I try to run the job [the job just pull a repo], I'm getting the following error:
Building in workspace D:\Jenkins\workspace\test C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository C:\Program Files\Git\bin\git.exe config remote.origin.url git@github.ABC.com:ABC/REPO.git # timeout=10 Fetching upstream changes from git@github.ABC.com:ABC/REPO.git C:\Program Files\Git\bin\git.exe --version # timeout=10 using GIT_ASKPASS to set credentials C:\Program Files\Git\bin\git.exe fetch --tags --force --progress git@github.ABC.com:ABC/REPO.git +refs/heads/:refs/remotes/origin/ ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from git@github.ABC.com:ABC/REPO.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1208) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1810) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --tags --force --progress git@github.ABC.com:ABC/REPO.git +refs/heads/:refs/remotes/origin/" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:886) ... 11 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE