Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-73049

Cloud Migration Assistant for Confluence import is breaking due to existing users

    XMLWordPrintable

Details

    Description

      Issue Summary

      When doing the export/import of spaces with the Cloud Migration Assistant for Confluence the users that are associated with content on the spaces will be created as inactive to keep the data association but one you try to import a new space that has the same users on it it will fail with the following message:

      97% - Import to cloud failed. Message: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: org.hibernate.exception.ConstraintViolationException: could not execute statement
      

      Environment

      Cloud Migration Assistant for Confluence - Confluence Cloud

      Steps to Reproduce

      1. Start migration of spaces using Cloud Migration Assistant for Confluence without users & groups

      Expected Results

      All the spaces will be migrated

      Actual Results

      Only the first space will be migrated and subsequent spaces will fail depending on the set of users that are associated with the content on those spaces

      We can see in the logs that it is failing to insert the user data:

       stack:	 com.atlassian.confluence.importexport.ImportExportException: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [25P02]; error code [0]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
      com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:479)
      ***
      java.lang.Thread.run(Thread.java:748)
      
      Caused by: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [25P02]; error code [0]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
      com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImport(DefaultXmlImporter.java:101)
      com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:462)
      ... 81 more
      
      Caused by: org.xml.sax.SAXException: Error while importing backup: org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [25P02]; error code [0]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
      ***
      com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImport(DefaultXmlImporter.java:88)
      ... 82 more
      ***
      
      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "unq_aaid"
        Detail: Key (aaid)=(ATLASSIAN_ID) already exists.
      org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
      org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)
      org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
      org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
      org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
      org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
      ***
      ... 115 more	
        	}	
        	 level:	 ERROR		
        	}	
        	 message:	 Error importing space.	
        	 micros_container:	 confluence	
        	 product:	 confluence	
      

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cmeireles Charles Meireles
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: