How to solve Jenkins checkout problems with OpenSSH

Article ID:360034860532
1 minute readKnowledge base

Issue

  • After an update of my operating system Jenkins cannot checkout the code from Git, showing issues like the following:

19:22:38 Caused by: hudson.plugins.git.GitException: Command "/usr/local/bin/git fetch --tags --progress git@my.git.server.com:acme/repo +refs/heads/*:refs/remotes/origin/*" returned status code 128:
19:22:38 stdout:
19:22:38 stderr: myuser@my.git.server.com: Permission denied (publickey).
19:22:38 fatal: Could not read from remote repository.
19:22:38
19:22:38 Please make sure you have the correct access rights
19:22:38 and the repository exists.

Resolution

There is a known issue that’s introduced by OpenSSH 7.7. Git Plugin has to be upgraded in order to work.

OpenSSH 7.7 breaks git-client plugin versions earlier than 2.7.3. ssh -V will show what version of OpenSSH is being used. Various versions of Windows, MacOS, Linux, and BSD bundle OpenSSH, and installing updates on them may break git access for users who have an older version of the plugin.

The fix is to upgrade the git-client plugin version to at least 2.7.3.