Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-78833

Concurrent edits to a webhook configuration in Jira 10 break all webhooks

XMLWordPrintable

    • 10
    • 12
    • Severity 2 - Major
    • 82
    • Hide
      Atlassian Update – 3 Jul 2025

      Dear Customers,

      This bug is fixed in Jira 10.3.8 LTS, 10.7.2 and above versions and I confirmed the functionality to be working as expected.

      Best regards

      Tomasz Ziółkowski
      Principal Software Engineer, Jira Platform

      Show
      Atlassian Update – 3 Jul 2025 Dear Customers, This bug is fixed in Jira 10.3.8 LTS, 10.7.2 and above versions and I confirmed the functionality to be working as expected. Best regards Tomasz Ziółkowski Principal Software Engineer, Jira Platform

      Issue Summary

      Concurrent webhook updates via the REST endpoint can duplicate parameters in the AO_A0B856_WEBHOOK_CONFIG table. These duplicate entries prevent the webhook configuration page from displaying and cause all existing webhooks to stop firing.

      Steps to Reproduce

      1. Install an affected Jira 10 version.
      2. Create a webhook in the UI.
      3. Concurrently update that webhook's JQL filter using the PUT /rest/jira-webhook/1.0/webhooks/<webhook-id> endpoint. See the attached script.
      4. Refresh the webhooks configuration page.

      Expected Results

      The changes are accepted, and the final JQL persists. Webhooks continue to fire.

      Actual Results

      1. The webhooks admin page displays: No Webhooks are configured.
      2. The following exception is thrown in the atlassian-jira.log for each PUT request:
        2025-05-23 14:00:00,000+0000 http-nio-8080-exec-1 ERROR charlie 1x1x1 abcdef 0.0.0.0 /rest/jira-webhook/1.0/webhooks/1 [c.a.p.r.v2.exception.ThrowableExceptionMapper] Uncaught exception 4c04b29d-866c-440f-8e55-d603e5db5683 thrown by REST service: Duplicate key FILTERS (attempted merging values project in ('CUT', 'LAASDCF', 'AB', 'M3')  and project in ('CSDUT', 'SAM', 'AB', 'EXA') )
        java.lang.IllegalStateException: Duplicate key FILTERS (attempted merging values project in ('CUT', 'LAASDCF', 'AB', 'M3')  and project in ('CSDUT', 'SAM', 'AB', 'EXA') )
        	at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
        	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
        	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
        	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        	at com.atlassian.webhooks.internal.DefaultWebhookService.getContext(DefaultWebhookService.java:492)
        	at com.atlassian.webhooks.internal.DefaultWebhookService.convert(DefaultWebhookService.java:396)
        	at com.atlassian.webhooks.internal.DefaultWebhookService.lambda$update$12(DefaultWebhookService.java:374)
        	[...]
        	at com.atlassian.webhooks.internal.DefaultWebhookService.update(DefaultWebhookService.java:363)
        	[...]
        	at com.atlassian.webhooks.internal.rest.WebhooksResourceHelper.update(WebhooksResourceHelper.java:401)
        	at com.atlassian.jira.plugins.webhooks.rest.GlobalWebhooksResource.updateWebhook(GlobalWebhooksResource.java:262)
        
      1. All webhooks stop firing.

      Workaround

      This workaround involves permanently deleting database records. Please consider performing a backup, testing the change in a lower environment, or executing SQL in a transaction with rollback support.

      1. Check for webhook configurations with duplicate parameters:
        SELECT "WEBHOOKID"
        FROM "AO_A0B856_WEBHOOK_CONFIG"
        GROUP BY ("KEY", "WEBHOOKID")
        HAVING COUNT(*) > 1;
        
      1. Remove the duplicated parameters, keeping the latest:
        DELETE
        FROM "AO_A0B856_WEBHOOK_CONFIG"
        WHERE "ID" NOT IN (SELECT a.max_id
                           FROM (SELECT MAX(wc."ID") AS max_id
                                 FROM "AO_A0B856_WEBHOOK_CONFIG" wc
                                 GROUP BY (wc."KEY", wc."WEBHOOKID")) AS a);
        

      Thanks to the Smartsheet team for helping identify this bug and providing the reproduction script.

        1. reproduction-script.js
          2 kB
        2. webhooks-admin-page.png
          webhooks-admin-page.png
          152 kB

              c05631dc8c5f Tomasz Ziółkowski
              1353e2e9fd2f Benjamin S
              Votes:
              31 Vote for this issue
              Watchers:
              32 Start watching this issue

                Created:
                Updated:
                Resolved: