Uploaded image for project: 'Confluence'
  1. Confluence
  2. CONF-45676

Copy page hierarchy doesn't work with SQL server

    Details

    • Symptom Severity:
      Critical
    • Support reference count:
      1
    • Sprint:
      Redfern, Sydney
    • QA Demo Status:
      Not Done
    • QA Kickoff Status:
      Not Needed

      Description

      Summary

      Unable to copy page hierarchy when using start Start titles with and Replace title text options

      Environment

      • Confluence 6.0.2
      • SQL Server 11.00.6020

      Steps to Reproduce

      1. Install confluence 6.0.2 and configure it with SQL server 11.00.6020 according to Database Setup for SQL Server
      2. Create a space with pages that contains child pages
      3. Click on the (...) and then pick copy
      4. Check "Include child pages" then hit next
      5. In the Start titles with put some random text, in my case new
      6. In the Replace title text put some random text, in my case ion
      7. In the With this text put some random text, in my case aaa
      8. Hit copy

      ps: see video for more details http://recordit.co/fIquIjx70V

      Expected Results

      Pages should be copied and text should be replaced

      Actual Results

      Error is showing "Something went wrong." and pages are not copied

      The below exception is thrown in the atlassian-confluence.log file:

      2016-12-30 14:48:52,346 ERROR [http-nio-8090-exec-3] [engine.jdbc.spi.SqlExceptionHelper] logExceptions The replace function requires 3 argument(s).
       -- referer: http://ec2-54-194-5-4.eu-west-1.compute.amazonaws.com:8090/display/OMAR/back-end+leverage+networks+-+1483105629502 | url: /rest/page-hierarchy/copy | traceId: b1d95ef835705392 | userName: admin
      2016-12-30 14:48:52,347 ERROR [http-nio-8090-exec-3] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Incorrect syntax near ')'.
       -- referer: http://ec2-54-194-5-4.eu-west-1.compute.amazonaws.com:8090/display/OMAR/back-end+leverage+networks+-+1483105629502 | url: /rest/page-hierarchy/copy | traceId: b1d95ef835705392 | userName: admin
      2016-12-30 14:48:52,358 ERROR [http-nio-8090-exec-3] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error :
       -- referer: http://ec2-54-194-5-4.eu-west-1.compute.amazonaws.com:8090/display/OMAR/back-end+leverage+networks+-+1483105629502 | url: /rest/page-hierarchy/copy | traceId: b1d95ef835705392 | userName: admin
      net.sf.hibernate.HibernateException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
          at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
          at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
          at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1407)
          at com.atlassian.hibernate.adapter.adapters.query.QueryV2Adapter.list(QueryV2Adapter.java:201)
      
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
          at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
          at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
          at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
          at org.hibernate.loader.Loader.getResultSet(Loader.java:2123)
          at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)
          at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887)
      
          at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1426)
          at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1398)
          ... 290 more
      Caused by: java.sql.SQLException: The replace function requires 3 argument(s).
          at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
          at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
          at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
          at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
          at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
          at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:379)
          at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
          ... 305 more
      caused by:
      java.sql.SQLException: Incorrect syntax near ')'.
          at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
          at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
          at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
          at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:677)
          at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
          at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:379)
      
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalStateException: Transaction already active
          at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:52)
          at org.hibernate.internal.AbstractSharedSessionContract.beginTransaction(AbstractSharedSessionContract.java:387)
          at com.atlassian.hibernate.util.TransactionHelper.beginTransactionCommitNested(TransactionHelper.java:28)
          at com.atlassian.hibernate.adapter.adapters.session.SessionV2Adapter.beginTransaction(SessionV2Adapter.java:507)
          at org.springframework.orm.hibernate.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:441)
          ... 177 more
      

      Notes

      This is working fine with other database

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Last commented:
                  4 weeks, 3 days ago