# Jenkins failed to trigger a build on pull request

**URL:** <https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111>\
**Category:** Using Jenkins\
**Tags:** question, docker, pipeline\
**Created:** [September 4, 2024, 6:46pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111 "2024-09-04T18:46:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 4, 2024, 6:46pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/1 "2024-09-04T18:46:00Z")

</div>

Hello,  
I am using Jenkins controller container 2.462.1 with two node agents,  
lately Jankins is failing on triggering builds when a pull request, jenkins logs is as follow:

```auto
Sep 03, 2024 2:32:29 PM INFO org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
Received PushEvent for https://github.com/XXXXX from 172.22.0.1 ⇒ https://XXXX/jenkins/github-webhook/
Sep 03, 2024 2:32:42 PM WARNING jenkins.scm.api.SCMHeadEvent$DispatcherImpl log
SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.MultiBranchProject$SCMEventListenerImpl@6404b594 propagated an exception
java.lang.ClassNotFoundException: org.objectweb.asm.ClassWriter
Caused: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadMixinEqualityGenerator.create(SCMHeadMixinEqualityGenerator.java:234)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadMixinEqualityGenerator.getOrCreate(SCMHeadMixinEqualityGenerator.java:152)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHead.equals(SCMHead.java:191)
	at java.base/java.util.HashMap.getNode(Unknown Source)
	at java.base/java.util.HashMap.containsKey(Unknown Source)
	at java.base/java.util.HashSet.contains(Unknown Source)
	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:182)
	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrievePullRequest(GitHubSCMSource.java:1245)
	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1085)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:326)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadCreate(MultiBranchProject.java:1375)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1208)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:545)
	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

```

when choosing to scan the repository now button, it will detect and build the new pull request.  
any suggestion is appreciated.

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 5, 2024, 6:23pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/2 "2024-09-05T18:23:12Z")

</div>

do you think the issue is between jenkins controller and GitHub or between Jenkins controller and Jenkins agent?  
I know that my jenkins controller is using newer java (17.0.12) while the salves are on openjdk 16.0.1 2021-04-20

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 9, 2024, 4:16pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/3 "2024-09-09T16:16:15Z")

</div>

team… any thoughts here, still not able to fix this?

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [September 10, 2024, 8:33am UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/4 "2024-09-10T08:33:54Z")

</div>

Welcome back, @zohair. 👋

The error message indicates that Jenkins is unable to find the `org.objectweb.asm.ClassWriter` class, which is causing a `NoClassDefFoundError`. This issue is likely due to a missing or incompatible plugin dependency.  
I can find quite [a few references](https://github.com/search?q=org%3Ajenkinsci%20org.objectweb.asm.ClassWriter&type=code) to this class in some plugins, particularly in the scm plugin that appears in your stack trace.

Here are some steps that may help to resolve this issue:

1. Ensure all your Jenkins plugins are up to date. Sometimes, plugin updates include necessary dependencies or fixes for such issues.
2. Verify that the required dependencies for the [scm-api](https://plugins.jenkins.io/scm-api/) and [github-branch-source](https://plugins.jenkins.io/github-branch-source/) plugins are installed. You can do this by checking the plugin documentation or the [Jenkins update center](https://www.jenkins.io/templates/updates/).
3. If updating doesn’t work, try reinstalling the affected plugins (scm-api, github-branch-source, etc.). Sometimes, plugin files can get corrupted. 🤷
4. Ensure that the versions of the plugins you are using are compatible with your Jenkins version ([2.462.1](https://www.jenkins.io/changelog-stable/2.462.1/)). Incompatible versions can cause such issues.

---

<div class="post-metadata">

**Author:** ![prashantgupta123](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/prashantgupta123/32/10102_2.png) [@prashantgupta123](https://community.jenkins.io/u/prashantgupta123)\
**Post date:** [September 11, 2024, 9:39am UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/5 "2024-09-11T09:39:38Z")

</div>

Hello Everyone,

We are also facing the issue for past few days where Jenkins was not able to trigger the build on pull request.  
Its a production environment we cannot update the Jenkins with latest version.  
Also plugins are giving the warning that if we upgrade to latest then it might be possible latest version is not compatible with old Jenkins Version.

```auto
Executor threw an exception
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadMixinEqualityGenerator.create(SCMHeadMixinEqualityGenerator.java:234)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHeadMixinEqualityGenerator.getOrCreate(SCMHeadMixinEqualityGenerator.java:152)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMHead.equals(SCMHead.java:191)
	at PluginClassLoader for branch-api//jenkins.branch.Branch.equals(Branch.java:279)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observeExisting(MultiBranchProject.java:2033)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2021)
	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357)
	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrievePullRequest(GitHubSCMSource.java:1245)
	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1085)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:282)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:654)
	at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:269)
	at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:167)
	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1057)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:446)

```

---

<div class="post-metadata">

**Author:** ![bpedersen2](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/bpedersen2/32/367_2.png) [@bpedersen2](https://community.jenkins.io/u/bpedersen2)\
**Post date:** [September 11, 2024, 11:49am UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/6 "2024-09-11T11:49:16Z")

</div>

The agents need to use the same java major version as the controller (for builds you can still have separate java installations), mixing java176 and java16 is a recipe for trouble.

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 11, 2024, 3:33pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/7 "2024-09-11T15:33:14Z")

</div>

> [@poddingue](#):
>
> NoClassDefFoundError

I insured all dependancies for both plugins scm-api and github-branch-source are up to date as well as the two plugins, that did not help me so far

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 11, 2024, 3:35pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/8 "2024-09-11T15:35:30Z")

</div>

I use a containerized aganets and was little afraid to play with it, I will try to update one of these agents and see how it

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 11, 2024, 8:39pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/9 "2024-09-11T20:39:27Z")

</div>

seems like mismatch java between controller and agent was not a problem, even it is not nice and I should do something about it, thanks to @poddingue and after a bunch of plugin updates the pipeline for PRs works just fine

---

<div class="post-metadata">

**Author:** ![zohair](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@zohair](https://community.jenkins.io/u/zohair)\
**Post date:** [September 11, 2024, 8:41pm UTC](https://community.jenkins.io/t/jenkins-failed-to-trigger-a-build-on-pull-request/19111/10 "2024-09-11T20:41:25Z")

</div>

thank you @poddingue updating plugins (+15) fixed my issue and pipeline is working now
