-
Suggestion
-
Resolution: Fixed
-
None
-
9
-
1
-
Hi,
We are working on Bamboo Microsoft Teams integration plugin.
Before we used Teams Incoming webhooks and length of webhook URL was enough to store it in RECIPIENT column, plus some extra parameters. The recipient config looks like 'URL|param1|param2|param3'
But since Microsoft announced migration to Workflows the URL is becoming longer(231 length) and notification can not be saved with the given parameters with the error:
[WARNING] [talledLocalContainer] ERROR BatchingBatch HHH000315: Exception executing batch [org.h2.jdbc.JdbcBatchUpdateException: Value too long for column "RECIPIENT VARCHAR(255)": "'99a90c12-d274-4bdb-9fac-a4141a00c92f|https://prod2-59.southeastasia.logic.azure.com:443/workflows/c8b036d857124b53a82b8fc398780... (325)"; SQL statement: [INFO] [talledLocalContainer] insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values (?, ?, ?, ?, ?, ?) [22001-200]], SQL: insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values (?, ?, ?, ?, ?, ?) [WARNING] [talledLocalContainer] ERROR SqlExceptionHelper Value too long for column "RECIPIENT VARCHAR(255)": "'99a90c12-d274-4bdb-9fac-a4141a00c92f|https://prod2-59.southeastasia.logic.azure.com:443/workflows/c8b036d857124b53a82b8fc398780... (325)"; SQL statement: [INFO] [talledLocalContainer] insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values (?, ?, ?, ?, ?, ?) [22001-200] [WARNING] [talledLocalContainer] ERROR ExceptionMappingInterceptor could not execute batch; SQL [insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values (?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.DataException: could not execute batch [INFO] [talledLocalContainer] org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values (?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.DataException: could not execute batch [INFO] [talledLocalContainer] at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:216) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate5.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:785) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate5.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy127.commit(Unknown Source) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy156.savePlan(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification.addNotification(ConfigureChainNotification.java:99)
Is it possible to increase the length of RECIPIENT column or any other ways to save custom notification.
The same is reproducible for the build-in Webhook notification if the URL is too long.
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 RECIPIENT column in NOTIFICATIONS Table to VARCHAR(1000)
MySQL 8.0 reference, please adjust it to your specific database product
ALTER TABLE NOTIFICATIONS ALTER COLUMN RECIPIENT 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 Teams 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
Hello,
We extended the RECIPIENT column size to 1000 characters. Because of the migration, the improvement could only be applied to the next Bamboo feature release and will be part of the Bamboo 10.1.0.
Kind regards,
Bamboo Development Team