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

Space export fails with error: "Couldn't backup database data"

      Summary

      Exporting selected pages of a relatively large space to XML will failed and the error message: "Couldn't backup database data" is shown in the UI

      Environment

      • Oracle 11g
      • Oracle 12
      • SQL Server
      • Microsoft SQL Server

      Steps to Reproduce

      1. Have Confluence connected to Oracle 11g
      2. Have a relatively large space (with 1000+ deleted pages in Oracle)
      3. Go to Space Tools > Content Tools > Export > XML
      4. Custom Export > Choose few pages
      5. Export

      Expected Results

      Export was successful

      Actual Results

      Export was not successful

      2015-12-08 14:36:48,837 ERROR [Long running task: Export Space] [confluence.importexport.impl.AbstractXmlExporter] backupEntities Couldn't backup database data.
       -- referer: https://www-test.wiki.ed.ac.uk/spaces/exportspacexml.action?key=GenePool | url: /spaces/doexportspace.action | userName: aforres3 | action: doexportspace
      org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      ...
      Caused by: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      ...
      

      This has also been observed with SQL Server:

      2018-10-22 23:08:42,036 WARN [Long running task: Export Space] [hibernate.query.internal.QueryParameterBindingsImpl] expandListValuedParameters HHH000443: Dialect [com.atlassian.confluence.impl.hibernate.dialect.SQLServerDialect] limits the number of elements in an IN predicate to 2100 entries.  However, the given parameter list [exclusions] contained 20701 entries, which will likely cause failures to execute the query in the database
      

      For the Confluence running on the MSSQL server, the error message in the logs is this one:

       2020-05-26 17:44:23,744 ERROR [Long running task: Export Space] [engine.jdbc.spi.SqlExceptionHelper] logExceptions The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
       – url: /spaces/doexportspace.action | referer: [https://xxxxxxxxxxxxxxxx:spaces/exportspacexml.action?key=SPACE] | traceId: 116358ab22940a24 | userName: xxxxxxx | action: doexportspace
       2020-05-26 17:44:23,745 ERROR [Long running task: Export Space] [confluence.importexport.impl.AbstractXmlExporter] backupEntities Couldn't backup database data.
       – url: /spaces/doexportspace.action | referer: [https://xxxxxxxxx/spaces/exportspacexml.action?key=SPAPCE] | traceId: 116358ab22940a24 | userName: XXXXXXXX | action: doexportspace
       org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
       at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:224)
       at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:368)
       at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:315)
       ...
       at java.lang.Thread.run(Thread.java:748)
       Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
       ....
       Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.

      Notes

      This is caused by some methods in confluence that returns more than 1000 entities/object. Oracle has a limitation of maximum acceptable number of entities in a list to be 1000

      On the MSSQL there is a hard-coded limit (2100) for the number of entries in the IN statement:

      https://github.com/Microsoft/msphpsql/blob/v4.2.0-preview/source/shared/core_sqlsrv.h#L172

      https://github.com/microsoft/msphpsql/issues/410

      Workaround

      Exporting the whole space to XML works alright. As such, by copying the pages to a new (empty) Space, and exporting the entire new Space, the pages should be exported successfully.

            [CONFSERVER-40394] Space export fails with error: "Couldn't backup database data"

            We have 7.4.8. and have this issue (with MSSQL), so it is not quite fixed I assume

            alexander.schultz@init.de added a comment - We have 7.4.8. and have this issue (with MSSQL), so it is not quite fixed I assume

            A fix for this issue is available to Server and Data Center customers in Confluence 7.6.3
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hasnae (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.6.3 Upgrade now or check out the Release Notes to see what other issues are resolved.

            A fix for this issue is available to Server and Data Center customers in Confluence 7.10.1
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hasnae (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.10.1 Upgrade now or check out the Release Notes to see what other issues are resolved.

            If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.6, which you can find in the Download Archives.

            Oliver Shen added a comment - If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.6, which you can find in the Download Archives .

            Peter-I added a comment -

            jmarfell, thank you! Glad this this fix made it in the 7.4 LTS release

            Peter-I added a comment - jmarfell , thank you! Glad this this fix made it in the 7.4 LTS release

            972c8973aa3b It is part of 7.4.6. I just updated this ticket to highlight that.

            Jen Marfell (Inactive) added a comment - 972c8973aa3b It is part of 7.4.6. I just updated this ticket to highlight that.

            Peter-I added a comment -

            jmarfell, I was checking the release notes for 7.4.6, however this fix is not listed there. Can you confirm which version is getting it?

            Peter-I added a comment - jmarfell , I was checking the release notes for 7.4.6, however this fix is not listed there. Can you confirm which version is getting it?

            We are now backporting this change to 7.4.6.

            Jen Marfell (Inactive) added a comment - We are now backporting this change to 7.4.6.

            MegaFon Team added a comment - - edited

            gonchik added a comment  6 days ago  edited
            Hi!
            Any plans to backport onto 7.4.x release?

            Because with that on 7.4.4

            Hi, 

            I join the question.
            7.4.x is stated as "Long Term Support release". This bug is quite critical and should be fixed in the LTS release.
             

            MegaFon Team added a comment - - edited gonchik  added a comment   6 days ago   edited Hi! Any plans to backport onto 7.4.x release? Because with that on 7.4.4 Hi,  I join the question. 7.4.x is stated as "Long Term Support release". This bug is quite critical and should be fixed in the LTS release.  

            Gonchik Tsymzhitov added a comment - - edited

            Hi!
            Any plans to backport onto 7.4.x release?

            Because with that on 7.4.4

            Gonchik Tsymzhitov added a comment - - edited Hi! Any plans to backport onto 7.4.x release? Because with that on 7.4.4

              bhyde Bradley Hyde
              jwaihou Jonathan Soo
              Affected customers:
              42 This affects my team
              Watchers:
              74 Start watching this issue

                Created:
                Updated:
                Resolved: