org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#139527563]; SQL []; Data truncation; nested exception is java.sql.DataTruncation: Data truncation

atlassian.com | 2 months ago
  1. 0

    Unable to View Pages Due to DataIntegrityViolationException - Atlassian Documentation

    atlassian.com | 2 months ago
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#139527563]; SQL []; Data truncation; nested exception is java.sql.DataTruncation: Data truncation
  2. 0

    After attempting to apply multiple user view restrictions to a page the attached error message is thrown. {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#1409029]; SQL []; Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) ... {noformat} The instance was running with SQL Server 2005, started with 4.0.5 and upgraded to 4.2

    Atlassian JIRA | 5 years ago | Joey Corea [Atlassian]
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#1409029]; SQL []; Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.
  3. 0

    Lets say you have a group called "Group" in confluence. Then you add a page permission via soap-api with deviating case in the group name, for example "GROUP". The page permission will be set and work correctly in that only members of "Group" can edit or view the page. However, you will not be able to make any changes to the pages permissions from the "normal" web interface. The dialog stays open and confluence log shows the following error: {code} 2014-02-10 16:21:39,738 ERROR [http-8443-120] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /pages/setpagepermissions.action | userName: tobias.kloht | referer: https://wiki.intact-is.com/display/talent/Private+Address+Claire+TestTwo_3 org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#60851953]; SQL []; Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at com.atlassian.xwork.interceptors.TransactionalInvocation.commitOrRollbackTransaction(TransactionalInvocation.java:107) ... {code} In this case the Group is called "Uk HR" (lowercase k), the permission was added via soap for "UK HR" (uppercase k). As described above the error occurs when adding or removing another user or group to/from the page permissions. The database entry for GROUPNAME in CONTENT_PERM reads "UK HR" when added via soap api whereas it is "Uk HR" when added via web interface. So to summarize it seems like when adding a new entry you search for all new entries and try to add them. If the casing doesn't match exactly you think the existing entry is new. Adding this group again fails obviously because it would be a duplicate entry.

    Atlassian JIRA | 3 years ago | Tobias Kloht
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#60851953]; SQL []; Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Lets say you have a group called "Group" in confluence. Then you add a page permission via soap-api with deviating case in the group name, for example "GROUP". The page permission will be set and work correctly in that only members of "Group" can edit or view the page. However, you will not be able to make any changes to the pages permissions from the "normal" web interface. The dialog stays open and confluence log shows the following error: {code} 2014-02-10 16:21:39,738 ERROR [http-8443-120] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /pages/setpagepermissions.action | userName: tobias.kloht | referer: https://wiki.intact-is.com/display/talent/Private+Address+Claire+TestTwo_3 org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#60851953]; SQL []; Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at com.atlassian.xwork.interceptors.TransactionalInvocation.commitOrRollbackTransaction(TransactionalInvocation.java:107) ... {code} In this case the Group is called "Uk HR" (lowercase k), the permission was added via soap for "UK HR" (uppercase k). As described above the error occurs when adding or removing another user or group to/from the page permissions. The database entry for GROUPNAME in CONTENT_PERM reads "UK HR" when added via soap api whereas it is "Uk HR" when added via web interface. So to summarize it seems like when adding a new entry you search for all new entries and try to add them. If the casing doesn't match exactly you think the existing entry is new. Adding this group again fails obviously because it would be a duplicate entry.

    Atlassian JIRA | 3 years ago | Tobias Kloht
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#60851953]; SQL []; Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '60818021-View-Uk HR' for key 'cp_unique_group'
  6. 0

    After attempting to apply multiple user view restrictions to a page the attached error message is thrown. {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#1409029]; SQL []; Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) ... {noformat} The instance was running with SQL Server 2005, started with 4.0.5 and upgraded to 4.2

    Atlassian JIRA | 5 years ago | Joey Corea [Atlassian]
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#1409029]; SQL []; Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constraint 'cp_unique_group'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.dao.DataIntegrityViolationException

      Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#139527563]; SQL []; Data truncation; nested exception is java.sql.DataTruncation: Data truncation

      at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate()
    2. Spring Framework
      AbstractFallbackSQLExceptionTranslator.translate
      1. org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100)
      2. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
      2 frames
    3. Hibernate
      HibernateTransactionManager.doCommit
      1. org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619)
      2. org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605)
      3. org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518)
      3 frames
    4. Spring Tx
      AbstractPlatformTransactionManager.commit
      1. org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
      2. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
      2 frames