Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-76042

Jenkins intermittently stops triggering builds on webhook events until restart

XMLWordPrintable

      Jenkins stops triggering builds on webhook events until restart

      We upgraded Jenkins server to version 2.504.1 LTS and after some time we started to notice that Jenkins intermittently stops reacting (triggering build) on webhook events from SCM (Bitbucket Server). Builds don't trigger on push/PR creation or updates. Restarting Jenkins temporarily restores webhook processing, but the issue recurs after some time and it's not clear why this happens.

      I don't see any relevant errors in the Jenkins logs. We use Bitbucket Branch Source and Bitbucket Server Integration plugins. When issue occurs, webhooks from both plugins stop working, so that I assume that the issue related to Jenkins itself, not to plugins.

      Webhook testing in BitBucket shows that all good (200 status code) and on Jenkins side I see that it receives that pings, for example:
       

      INFO    c.c.j.p.b.h.NativeServerPingHookProcessor#process: Received webhook ping event from 10.X.X.X ⇒ https://jenkins.mydomain.net/bitbucket-scmsource-hook/notify
      

      I added loggers for both plugins, and see that they both received webhook event

      Bitbucket Branch Source plugin:

      FINE com.cloudbees.jenkins.plugins.bitbucket.hooks.BitbucketSCMSourcePushHookReceiver
      server_url request parameter found. Bitbucket Native Server webhook incoming.

      Bitbucket Server Integration plugin:

      FINE com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookEndpoint
      Payload: com.atlassian.bitbucket.jenkins.internal.trigger.events.RefsChangedWebhookEvent@xxxxxxxx
      FINE com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer
      Received Refs Changed event from repo: PROJECT/my-repo

      But Jenkins doesn't trigger build for the brunch, newly created branches doesn't appear in Jenkins UI and branches deleted from SCM stay in Jenkins UI.

      Environment

      Jenkins version: 2.504.1 LTS
      Java runtime & version: java-21-openjdk-21.0.7.0.6-1
      Bitbucket Branch Source plugin version: 936.1.1
      Bitbucket Server Integration plugin version: 4.2.0
      SCM: Atlassian Bitbucket v8.19.20
      Job type tested: Multibranch Pipeline / Pipeline

      Steps to reproduce

      I can't reproduce it on purpose because the problem appears intermittently. Nothing special:

      1. Configure Multibranch Pipeline / Pipeline with Bitbucket as SCM and webhooks enabled.
      2. Confirm initial webhooks trigger scans/builds.
      3. Wait until the system stops reacting
      4. Push a commit / update a PR in Bitbucket.
      5. Observe: no Jenkins activity.
      6. Restart Jenkins.
      7. Repeat step 4 → builds trigger again.

      Frequency

      Can't say exactly, it may work for weeks without any issue after restart, or suddenly stop triggering build after a couple of days after restart.

      Bitbucket webhook details

      • Events enabled: Repo/Push
      • Delivery status in Bitbucket: Success (200)

      Expected behavior

      Jenkins should trigger scans/builds for matching jobs on every valid webhook

      Jenkins logs & diagnostics

      I do not see errors in logs that I could relate this issue to. I need help here, what else I can check / collect / enable, to find out a reason?

       

            Unassigned Unassigned
            igorigorb Igor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: