-
Bug
-
Resolution: Fixed
-
Low
-
7.2.1
-
None
-
2
-
Severity 3 - Minor
-
Issue Summary
When editing a plan Webhooks notification without any changes, causes an error
Steps to Reproduce
- Create a Webhooks notification in a deployment environment
- Edit the notification
- Make no change and save the notification
Expected Results
The notification setting pop up is closed
Actual Results
Page throws an exception
An unexpected error has occurred 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 (?, ?, ?, ?, ?, ?)]; constraint [notifications_unique]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:245) at org.springframework.orm.hibernate5.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:802) at org.springframework.orm.hibernate5.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:638) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714) at sun.reflect.GeneratedMethodAccessor254.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) at com.sun.proxy.$Proxy115.commit(Unknown Source) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:534) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:305) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy212.replaceNotification(Unknown Source) ... Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into NOTIFICATIONS (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA, NOTIFICATION_RULE_ID) values ('com.atlassian.bamboo.plugin.system.notifications:recipient.webhook', 'd2da5014-ca25-4bc3-a077-9f490359030f|https://webhook.site/446a8f1e-55ce-4bb3-8987-9dfbe6288a34', 655363, 'bamboo.deployments:deploymentStartedFinished', '', 819213) was aborted: ERROR: duplicate key value violates unique constraint "notifications_unique" Detail: Key (recipient_type, recipient, notification_set, condition_key, condition_data)=(com.atlassian.bamboo.plugin.system.notifications:recipient.webhook, d2da5014-ca25-4bc3-a077-9f490359030f|https://webhook.site/446a8f1e-55ce-4bb3-8987-9dfbe6288a34, 655363, bamboo.deployments:deploymentStartedFinished, ) already exists. Call getNextException to see other errors in the batch. at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:159) at org.postgresql.core.ResultHandlerDelegate.handleError(ResultHandlerDelegate.java:50) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2268) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510) at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851) at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874) at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563) at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java) at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:121) ... 305 more Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "notifications_unique" Detail: Key (recipient_type, recipient, notification_set, condition_key, condition_data)=(com.atlassian.bamboo.plugin.system.notifications:recipient.webhook, d2da5014-ca25-4bc3-a077-9f490359030f|https://webhook.site/446a8f1e-55ce-4bb3-8987-9dfbe6288a34, 655363, bamboo.deployments:deploymentStartedFinished, ) already exists.
Workaround
Ignore the error.