• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 11.0.0, 10.2.2
    • 9.6.8, 10.2.0
    • Notifications
    • None

      Issue Summary

      If webhook notifications are configured at a plan or deployment and the webhook URL exceeds 255 characters, Bamboo will fail to insert the webhook response into the WEBHOOK_RESPONSE table. This is because the URL column in that table can only accommodate up to 255 characters.

      There won't be any issue in the Bamboo UI, and the plan or deployment will complete successfully. However, if the WEBHOOK_RESPONSE table is required for audit purposes, it will fail to insert the record when the webhook URL exceeds 255 characters.

      This is reproducible on Data Center: Yes

      Steps to Reproduce

      1. Create a plan or deployment
      2. Configure notifications with Recipient Type as Webhooks
      3. Enter the Webhook URL greater then 255 characters.
      4. Run the plan and check the output in the WEBHOOK_RESPONSE table.

      Expected Results

      Record should get inserted with the actual response in the WEBHOOK_RESPONSE table

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      2025-02-18 17:14:15,399 WARN [Webhook-1] [SqlExceptionHelper] SQL Error: 0, SQLState: 22001
      2025-02-18 17:14:15,399 ERROR [Webhook-1] [SqlExceptionHelper] Batch entry 0 insert into WEBHOOK_RESPONSE (DEPLOYMENT_RESULT_ID, EVENT_NAME, HTTP_METHOD, STACK_TRACE, PLAN_RESULT_KEY, RECEIVE_TIME, REQUEST_BODY, REQUEST_HEADERS, RESPONSE_BODY, RESPONSE_HEADERS, STATUS, RETRIES_COUNT, SEND_TIME, STATUS_CODE, TEMPLATE_NAME, URL, UUID, WEBHOOK_RESPONSE_ID) values ((NULL), ('Completed Plan Notification'), ('POST'), (NULL), ('TP-NOT-3'), (NULL), ('{
       (log message continued...)   "uuid": "6e7a265d-5501-470f-b424-471bd19b96c2",
       (log message continued...)   "timestamp": "2025-02-18 17:14:15 +1100",
       (log message continued...)   "notification": "Completed Plan Notification",
       (log message continued...)   "webhook": {
       (log message continued...)     "webhookTemplatedId": "393217",
       (log message continued...)     "webhookTemplatedName": "Build webhook"
       (log message continued...)   },
       (log message continued...)   "build": {
       (log message continued...)     "buildResultKey": "TP-NOT-3",
       (log message continued...)     "status": "SUCCESS",
       (log message continued...)     "buildPlanName": "Test Project - Notifications",
       (log message continued...)     "startedAt": "2025-02-18 17:14:14 +1100",
       (log message continued...)     "finishedAt": "2025-02-18 17:14:15 +1100",
       (log message continued...)     "triggerReason": "Manual build",
       (log message continued...)     "triggerSentence": "was manually triggered by user12345"
       (log message continued...)   }
       (log message continued...) }'), ('[content-type:"application/json"]'), (NULL), (NULL), ('PENDING'), ('0'::int4), ('2025-02-18 17:14:15.395+11'), (NULL), ('Build webhook'), ('https://www.example.com/this-is-an-example-of-a-url-that-contains-more-than-two-hundred-and-fifty-five-characters-and-continues-with-additional-parameters-to-show-its-length/?query1=value1&query2=value2&query3=value3&query4=value4&query5=value5&query6=value6&query7=value7&query8=value8&query9=value9'), ('6e7a265d-5501-470f-b424-471bd19b96c2'), ('2523139'::int8)) was aborted: ERROR: value too long for type character varying(255)  Call getNextException to see other errors in the batch.
      2025-02-18 17:14:15,399 ERROR [Webhook-1] [SqlExceptionHelper] ERROR: value too long for type character varying(255)
      2025-02-18 17:14:15,612 WARN [Webhook-1] [RESTCall] Response from POST https://www.example.com/this-is-an-example-of-a-url-that-contains-more-than-two-hundred-and-fifty-five-characters-and-continues-with-additional-parameters-to-show-its-length/?query1=value1&query2=value2&query3=value3&query4=value4&query5=value5&query6=value6&query7=value7&query8=value8&query9=value9 (403)
      

      Workaround

      Option 1: Modify the Database

      Important, please read.

      Ensure you have taken a database snapshot after Bamboo is stopped, so that you can revert back to the previous state of DB if needed. Ensure you have taken a database backup/dump before running any INSERT, UPDATE,ALTER or DELETE statements.

      Some databases such as MySQL 5.7 will not support modifying columns above the VARCHAR(255) characters limit. In that case please consider upgrading the DB or check Option 2.

      1. Stop Bamboo. 
      2. Alter the data type for URL column in WEBHOOK_RESPONSE Table to VARCHAR(1000)
        MySQL 8.0 reference, please adjust it to your specific database product
        ALTER TABLE WEBHOOK_RESPONSE ALTER COLUMN URL VARCHAR(1000)
        
      1. Start Bamboo

      Option 2: Use a URL shortener & Webhook forward service

      You can use a tool such as Zapier (more here) to reduce the URL to a smaller size while still forwarding POST webhook requests to the final endpoint. – This solution is not tested or endorsed by Atlassian and may require a paid subscription.

            [BAM-26036] Extend URL column length in WEBHOOK_RESPONSE table

            Alexey Chystoprudov made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Jonathan Barth made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 989844 ]
            Mateusz Szmal made changes -
            Fix Version/s New: 10.2.2 [ 110830 ]
            Mateusz Szmal made changes -
            Remote Link New: This issue links to "+core+ Dogfooding › TBD Test Git Branch Detection › issue-BAM-26036-extend-webhook-url-column-backport (tardigrade-bamboo)" [ 989727 ]
            Mateusz Szmal made changes -
            Remote Link New: This issue links to "+core+ New and Tasty › B Upgrade Builds › issue-BAM-26036-extend-webhook-url-column-backport (tardigrade-bamboo)" [ 989726 ]
            Mateusz Szmal made changes -
            Fix Version/s New: 11.0.0 [ 110791 ]
            Mateusz Szmal made changes -
            Status Original: In Progress [ 3 ] New: Waiting for Release [ 12075 ]
            Mateusz Szmal made changes -
            Status Original: Needs Triage [ 10030 ] New: In Progress [ 3 ]
            Mateusz Szmal made changes -
            Assignee New: Mateusz Szmal [ 851f15845f55 ]
            Mateusz Szmal made changes -
            Remote Link New: This issue links to "+core+ Dogfooding › TBD Test Git Branch Detection › issue-BAM-26036-extend-webhook-url-column (tardigrade-bamboo)" [ 989827 ]

              851f15845f55 Mateusz Szmal
              d4e7ab297885 Venkata Sateesh Pentela
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: