HEAD" 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
HEAD" 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
See the git client plugin documentation section on host key verification. You have several choices:
~/.ssh/known_hosts
on all agents and use the âknown hostsâ strategyHey I have also same issue. My Jenkins hosted on Kubernetes cluster using helm, I have set Git Host Key Verification Configuration as âknown_hostsâ , ofcourse I have created configured SSH Username with private key in Jenkins UI. But Jenkins job thrown this error âHost key verification failed.
fatal: Could not read from remote repository.Youâre using âKnown hosts fileâ strategy to verify ssh host keys, but your known_hosts file does not exist, please go to âManage Jenkinsâ â âConfigure Global Securityâ â âGit Host Key Verification Configurationâ and configure host key verification.â
Please help. Thanks.!!
The message says that the agent does not have the ~/.ssh/known_hosts
file on its file system.
When you choose the known hosts strategy, you are responsible to place the known_hosts file on the agent file system. If you donât have easy control of the contents of the agent file system, then you probably should choose a different strategy, like âaccept firstâ. I prefer âaccept firstâ for any case that does not involve CentOS 7 agents.
If you canât avoid CentOS 7 agents, then you could use the manually provided key strategy and provide the list of keys. See the git client plugin documentation for the details of your choices and the impact of those choices.
Thanks for reply. My requirement should choose the known hosts strategy, but i dont have control on agent file system. By the I could achieve with other options âaccept first connectionâ and âmanually provide keysâ. Getting issue only for âknown hostsâ
Then your requirement cannot be satisfied. If you canât place the known_hosts
file on the agent file system, then the known hosts strategy cannot work. The known hosts strategy requires a known_hosts file on the agent file system.
Either your requirement must change (my recommendation) or your control of the agent file system must change.
Thank you Mark for your suggestions.! will follow other than known_hosts file strategy