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

Webhook auto registration fail with PLUGIN implementation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • bitbucket-branch-source-plugin 936.4.2
    • 936.4.4

      Automatic registration of POST webhooks (Using the plugin) seems to have broken since 936.2.0, specifically due to implementation around Secrets.

      The error thrown looks like this in the log (Redacted company information):

      Jun 24, 2025 12:29:22 PM WARNING com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1 doRun
      Could not register hooks for [REDACTED_PROJECT]/[REDACTED_REPO]
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error.Status:  HTTP 500
      Response: {"message":"Unrecognized field \"secret\" (Class nl.topicus.bitbucket.old.WebHookConfigurationModel), not marked as ignorable\n at [Source: com.atlassian.stash.internal.web.util.web.CountingServletInputStream@48f68a31; line: 1, column: 15] (through reference chain: nl.topicus.bitbucket.old.WebHookConfigurationModel[\"secret\"])", "status-code":500}
      X-AREQUESTID: [REDACTED]
      X-AUSERID: [REDACTED]
      X-AUSERNAME: <REDACTED_USERNAME>
      X-Content-Type-Options: nosniff
      vary: accept-encoding
      Content-Type: application/json
      Transfer-Encoding: chunked
      Date: Tue, 24 Jun 2025 12:29:22 GMT
      Connection: close
      Set-Cookie: [REDACTED_COOKIE]
      Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.buildResponseException(AbstractBitbucketApi.java:94)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.doRequest(AbstractBitbucketApi.java:260)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.putRequest(AbstractBitbucketApi.java:321)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.registerCommitWebHook(BitbucketServerAPIClient.java:634)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHook(WebhookAutoRegisterListener.java:181)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHooks(WebhookAutoRegisterListener.java:136)
          at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1.doRun(WebhookAutoRegisterListener.java:105)
          at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:92)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
          at java.base/java.lang.Thread.run(Thread.java:1583)

      Looking at the API Description for the POST Webhook plugin, it seems the "secret" element is causing it to malformed.

      I'm only half-guessing here, but it could be due to something around here, as the switch has added setSecret call to the PLUGIN case:
      https://github.com/jenkinsci/bitbucket-branch-source-plugin/compare/936.1.1...936.2.0#diff-741f039d486b24818cadcb0d7a20c7b3c6b12aef07e2460957f1ebbe1e5f554bR210 

      And the form error notes that the PLUGIN webhook does not support Signature Verification:

      We are not currently able to move to NATIVE implementation, as this enforces ADMIN privileges of the repo, whereas the plugin can be configured to allow creation of webhooks on WRITE level privileges.

      We have rolled back to 936.1.1 and functionality is restored. However this also blocks updating BlueOcean plugins beyond 1.27.19, so downgrade is not limited to Bitbucket functionality

            nfalco Nikolas Falco
            blancster Martin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: