Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-6092

Cannot create new user due to primary key violation or unique constraint error

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.2.1
    • 2.2
    • None

      Here are the exceptions from various databases:

      Oracle:

      org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: ORA-00001: unique constraint (CWK.SYS_C002106) violated
      at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
      caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (CWK.SYS_C002106) violated
      at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)

      MS SQL Server:

      org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK_os_user_5070F446'. Cannot insert duplicate key in object 'os_user'.
      at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
      caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK_os_user_5070F446'. Cannot insert duplicate key in object 'os_user'.
      at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)

      MySQL:

      org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Duplicate entry '1' for key 1
      at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
      caused by: java.sql.BatchUpdateException: Duplicate entry '1' for key 1
      at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)

            [CONFSERVER-6092] Cannot create new user due to primary key violation or unique constraint error

            The new patch also solved my problem! thank you

            Jenneke Godschalk added a comment - The new patch also solved my problem! thank you

            Arno: You should remove the 'atlassian-bucket-2006.04.11.jar'.

            Jenneke: it is most likely related. The patch is not difficult to apply so you can try it (just backup the old bucket jar so you can roll back to it if it doesn't work).

            Cheers,
            Dave

            dave (Inactive) added a comment - Arno: You should remove the 'atlassian-bucket-2006.04.11.jar'. Jenneke: it is most likely related. The patch is not difficult to apply so you can try it (just backup the old bucket jar so you can roll back to it if it doesn't work). Cheers, Dave

            I'm also encountering problems with creating a new user. I'm getting the following system error:

            org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [failed batch]; nested exception is java.sql.BatchUpdateException: failed batch
            at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:94)
            caused by: java.sql.BatchUpdateException: failed batch
            at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)

            Can we solve this prolem with the same patch?

            We are using the standard installation of Confluence with JDK 1.5

            Jenneke Godschalk added a comment - I'm also encountering problems with creating a new user. I'm getting the following system error: org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [failed batch] ; nested exception is java.sql.BatchUpdateException: failed batch at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:94) caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) Can we solve this prolem with the same patch? We are using the standard installation of Confluence with JDK 1.5

            I see a atlassian-bucket-2006.04.11.jar and a atlassian-user-2006-04-18a.jar in my WEB-INF/lib directory. Which of the two should I delete after copying in atlassian-bucket-2006.04.11-createuser-patch.jar?

            Arno Bosse added a comment - I see a atlassian-bucket-2006.04.11.jar and a atlassian-user-2006-04-18a.jar in my WEB-INF/lib directory. Which of the two should I delete after copying in atlassian-bucket-2006.04.11-createuser-patch.jar?

            To fix this problem, copy the patched atlassian-bucket jar to your confluence/WEB-INF/lib directory, remove the old atlassian-user-2006.04.11.jar and restart Confluence. You should now be able to add users again.

            Cheers,
            Dave

            dave (Inactive) added a comment - To fix this problem, copy the patched atlassian-bucket jar to your confluence/WEB-INF/lib directory, remove the old atlassian-user-2006.04.11.jar and restart Confluence. You should now be able to add users again. Cheers, Dave

              Unassigned Unassigned
              dave@atlassian.com dave (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: