yuwan
yuwan

Reputation: 34

Jenkins job set GitHub hook trigger for GITScm polling, but hook trigger build fail

The problem is: the build is not triggered after the code is submitted

I have a "Freestyle project" Jenkins job that has set GitHub hook trigger for GITScm polling。

job set

The system settings of Jenkins are configured with github server and the test connection is successful。

Jenkins system setting

github-> webhook also shows that the message was sent successfully

github hook log

But after submitting the code to github, no build was triggered. The github hook log of the job showed “FATAL: hudson.plugins.git.GitException: Command "/usr/bin/git ls-remote -h [email protected]:yuwan1994/jenkinsdemo. git" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository.” github hook log

I tried to connect to the server and executed the command "/usr/bin/git ls-remote -h [email protected]:yuwan1994/jenkinsdemo.git", but the final revised version was returned, but the final version and github hook log showed Different versions. The server display is correct

enter image description here

Software versions:

Jenkins - 2.319.1 GitHub plugin - 1.34.1 Server System - Centos7 Server Git - 1.8.3.1

Upvotes: 0

Views: 1784

Answers (1)

yuwan
yuwan

Reputation: 34

Job->Configure->Source Code Management->Git->Repository URL need to use web url, don't use ssh url. Then choose jenkins credentials. If there is no link error, the link is normal. ssh url

http url

Upvotes: 0

Related Questions