Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-25835

Extend notification RECIPIENT column in NOTIFICATIONS table

    • 9
    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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

      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 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)
        
      3. 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.

            [BAM-25835] Extend notification RECIPIENT column in NOTIFICATIONS table

            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

            Mateusz Szmal added a comment - 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

              851f15845f55 Mateusz Szmal
              1619d74afc57 alexey
              Votes:
              6 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: