简体   繁体   中英

Why are my github changes not triggering builds in jenkins?

Github webhooks go out with a 200 response from jenkins.
Then this happens in the Jenkins logs...

INFO    o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for https://github.com/org/repo from 140.82.115.82 ⇒ https://jenkins-url/github-webhook/
INFO    o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for https://github.com/org/repo from 140.82.115.102 ⇒ https://jenkins-url/github-webhook/

WARNING j.s.a.SCMHeadEvent$DispatcherImpl#log: SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.MultiBranchProject$SCMEventListenerImpl@341c3595 propagated an exception

java.lang.NoClassDefFoundError: com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource$MercurialRevision
    at org.jenkinsci.plugins.scm_filter.BitbucketCommitMessageBranchBuildStrategy.getMessage(BitbucketCommitMessageBranchBuildStrategy.java:34)
    at org.jenkinsci.plugins.scm_filter.CommitMessageBranchBuildStrategy.isAutomaticBuild(CommitMessageBranchBuildStrategy.java:50)
    at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:260)
    at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.isAutomaticBuild(MultiBranchProject.java:2247)
    at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.doAutomaticBuilds(MultiBranchProject.java:2198)
    at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observeExisting(MultiBranchProject.java:2024)
    at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1984)
    at jenkins.scm.api.SCMHeadObserver$Wrapped.observe(SCMHeadObserver.java:637)
    at jenkins.scm.api.SCMHeadEvent$Validated.observe(SCMHeadEvent.java:295)
    at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357)
    at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
    at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1056)
    at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
    at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadUpdate(MultiBranchProject.java:1585)
    at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1190)
    at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
    at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
    at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:505)
    at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Why is the build not triggered?
Why is the bitbucket plugin triggered looking for some mercurial class?

Since it is a multibranch configuration I couldn't find build triggers.
The best solution that I could find is to add the following to the Jenkinsfile

triggers {
  githubPush()
}

After this you trigger the build manually once and the build on github push works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM