Failed to connect to git repository after upgrade to Jenkins 2.332.1 with Git Source Code Management

Viewed 308

Upgraded Jenkins to 2.332.1 and a few plugins to try to stay up to date. Now getting the following error:

Failed to connect to repository : Command “/usr/bin/git ls-remote -h git-repo-link HEAD” returned status code 128:
stdout:
stderr: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have no problem cloning the repo from command line. I have tried deleting the workspace, downgrading a few of the plugins, adding the Wipe out repository & force clone in Additional Behaviors under Source Code Management, and a few others.

I can connect to my repo without problem from command line by cloning and/or running ssh -T git@repo-url

Credentials Plugin v2.6.1 Git Plugin v4.11.0 Git Client Plugin v3.11.0 GIT Server Plugin v1.10

Any help besides working through hours of manually downgrades is greatly appreciated

1 Answers

Instead of GIT_SSH_COMMAND, you can make a simple job or pipeline, without any SCM component (nothing to clone), with a single step

sh "ssh -Tv git@repoServer"

That way, you can check which user and keys are used by Jenkins, and see if anything has changed.

Related