mslavs
mslavs

Reputation: 33

jenkins cannot read from remote repository

this is my pipeline script:

pipeline {
    agent any
    stages {
      stage('MVD python') {
          steps {
              git url: 'ssh://[email protected]:7999/lg6/mvdzos.git',
                  credentialsId: 'edawes',
                  branch: 'master'

              sh 'ls -l'
           }
      }
    }
}

simply trying to test if i can get access to the repo however I am getting the error

Fetching upstream changes from ssh://[email protected]:7999/lg6/mvdzos.git

git --version # timeout=10 git fetch --tags --progress ssh://[email protected]:7999/lg6/mvdzos.git +refs/heads/:refs/remotes/origin/ ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://[email protected]:7999/lg6/mvdzos.git +refs/heads/:refs/remotes/origin/" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository.

beyond the obvious access rights issue which I am pretty sure I have, what else could the problem be?

Upvotes: 0

Views: 12644

Answers (3)

Joerg S
Joerg S

Reputation: 5149

On all Jenkins nodes where this would be probably running (that is all including the master if it has some executors configured) you'll need to make sure to have a working ssh configuration.

In particular it tells you that there's some issue with the host key verification. Logon to that machine and check whether. While playing around on that machine you may use ssh [email protected]:7999 to see whether you fixed the issue.

  • Any possible existing host key probably needs an update
  • Strict host key checking is enabled (in ~/.ssh/config) but there's no host key given in ~/.ssh/known_hosts

Upvotes: 0

Jim Redmond
Jim Redmond

Reputation: 5660

This part of the error:

stderr: Host key verification failed

is what's going on here - your Jenkins can't confirm that git.rocketsoftware.com:7999 is legitimate, so it's bailing on the whole procedure.

Does Jenkins have a known_hosts file you can add that server to?

Upvotes: 0

brass monkey
brass monkey

Reputation: 6781

Try to execute the git command that causes to error on the Jenkins server as the Jenkins user.

git fetch --tags --progress ssh://[email protected]:7999/lg6/mvdzos.git

You might get an SSH warning which you have to confirm manually.

Upvotes: 0

Related Questions