-
Bug
-
Resolution: Fixed
-
Low
-
9.6.8, 10.2.0
-
None
-
1
-
Severity 3 - Minor
-
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
- Create a plan or deployment
- Configure notifications with Recipient Type as Webhooks
- Enter the Webhook URL greater then 255 characters.
- 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
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.
- Stop Bamboo.
- 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)
- 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.
- mentioned in
-
Page Failed to load
[BAM-26036] Extend URL column length in WEBHOOK_RESPONSE table
Resolution | New: Fixed [ 1 ] | |
Status | Original: Waiting for Release [ 12075 ] | New: Closed [ 6 ] |
Remote Link | New: This issue links to "Page (Confluence)" [ 989844 ] |
Fix Version/s | New: 10.2.2 [ 110830 ] |
Remote Link |
New:
This issue links to "+core+ Dogfooding › TBD Test Git Branch Detection › issue- |
Remote Link |
New:
This issue links to "+core+ New and Tasty › B Upgrade Builds › issue- |
Fix Version/s | New: 11.0.0 [ 110791 ] |
Status | Original: In Progress [ 3 ] | New: Waiting for Release [ 12075 ] |
Status | Original: Needs Triage [ 10030 ] | New: In Progress [ 3 ] |
Assignee | New: Mateusz Szmal [ 851f15845f55 ] |
Remote Link |
New:
This issue links to "+core+ Dogfooding › TBD Test Git Branch Detection › issue- |