XWiki Platform
  1. XWiki Platform
  2. XWIKI-7564

Upgrade from a version before 3.3 fails when running on a PostgreSQL database

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5
    • Fix Version/s: 4.0-milestone-2, 3.5.1
    • Component/s: Old Core, Storage
    • Labels:
      None
    • Environment:
      Debian Linux, PostgreSQL 8.4, Tomcat 6, JDK 1.6,
    • keywords:
      upgrade,postgresql
    • Difficulty:
      Unknown
    • Similar issues:
      XWIKI-7645Upgrading from a version before 3.3 causes all attachments to be broken when running on an Oracle database
      XWIKI-7712Migrating from older versions to 4.0 fails when running on a PostgreSQL database during the ID migration
      XWIKI-7763Database migration (upgrade) fails from 3.5 to 4.0 with PostgreSQL
      XWIKI-803Upgrade from 0.9.840 to 1.0 Beta fails when using PostgreSQL
      XWIKI-2074Database Migration fails when migrating from 1.0 or older directly to 1.2 without going through a 1.1 upgrade
      XWIKI-6819OpenOffice internal-managed integration failed with OOO 3.3
      XWIKI-1994Lot of init erros with PostgreSQL
      XWIKI-7232Encoding trouble in page versions (on Postgresql)
      XWIKI-8484Migration from a 2.7.2 to 4.3-RC1 fails on MySQL
      XWIKI-7418Import of .xar package from older xwiki fails

      Description

      Upgrade to xwiki-enterprise-web-3.2.war from 3.0 or 3.1.1 fails. Tomcat is starting, but after opening xwiki in web browser I get many errors in catalina.out

      2011-10-31 20:46:01,471 [https://..../xwiki/bin/view/Main/WebHome] ERROR o.h.u.JDBCExceptionReporter    - Bad value for type long : <?xml version="1.0" encoding="UTF-8"?>
      <xwikidoc>
      <web>Scheduler</web>
      <name>WatchListJob2</name>
      <language></language>
      <defaultLanguage></defaultLanguage>
      <translation>0</translation>
      <parent>XWiki.XWikiClasses</parent>
      <creator>XWiki.Admin</creator>
      [...]
      
      2011-10-31 20:46:03,178 [https://..../xwiki/bin/view/Main/WebHome] WARN  o.a.s.a.RequestProcessor       - Unhandled Exception thrown: class com.xpn.xwiki.XWikiException 
      Oct 31, 2011 8:46:03 PM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet action threw exception
      com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
      Wrapped Exception: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiUsers
      Wrapped Exception: Error number 3211 in 3: Exception while updating archive XWiki.XWikiUsers
      Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
      Wrapped Exception: could not load an entity: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent#component[docId,version1,version2]{docId=495778886, version2=1, version1=4}]
              at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:422)
              at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:491)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:136)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:128)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:217)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
              at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
              at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
              at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
              at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
              at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
              at java.lang.Thread.run(Thread.java:662)
      
      Wrapped Exception:
      
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiUsers
      Wrapped Exception: Error number 3211 in 3: Exception while updating archive XWiki.XWikiUsers
      Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
      Wrapped Exception: could not load an entity: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent#component[docId,version1,version2]{docId=495778886, version2=1, version1=4}]
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:690)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:174)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:167)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1406)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1362)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1357)
              at com.xpn.xwiki.XWiki.getUserClass(XWiki.java:3078)
              at com.xpn.xwiki.XWiki.initializeMandatoryClasses(XWiki.java:843)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:817)
              at com.xpn.xwiki.XWiki.<init>(XWiki.java:743)
              at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:405)
              at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:491)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:136)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:128)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:217)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      [...]
      Wrapped Exception:
      
      com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
      Wrapped Exception: could not load an entity: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent#component[docId,version1,version2]{docId=495778886, version2=1, version1=4}]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1097)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:1127)
              at com.xpn.xwiki.store.XWikiHibernateVersioningStore.loadRCSNodeContent(XWikiHibernateVersioningStore.java:298)
              at com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo.getContent(XWikiRCSNodeInfo.java:175)
              at com.xpn.xwiki.doc.XWikiDocumentArchive.makePatch(XWikiDocumentArchive.java:138)
              at com.xpn.xwiki.doc.XWikiDocumentArchive.updateArchive(XWikiDocumentArchive.java:254)
              at com.xpn.xwiki.store.XWikiHibernateVersioningStore.updateXWikiDocArchive(XWikiHibernateVersioningStore.java:254)
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:483)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:174)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:167)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1406)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1362)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1357)
              at com.xpn.xwiki.XWiki.getUserClass(XWiki.java:3078)
              at com.xpn.xwiki.XWiki.initializeMandatoryClasses(XWiki.java:843)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:817)
              at com.xpn.xwiki.XWiki.<init>(XWiki.java:743)
              at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:405)
              at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:491)
      [...]
      Wrapped Exception:
      
      org.postgresql.util.PSQLException: Bad value for type long : <?xml version="1.0" encoding="UTF-8"?>
      <xwikidoc>
      <web>XWiki</web>
      <name>XWikiUsers</name>
      <language></language>
      <defaultLanguage>en</defaultLanguage>
      <translation>1</translation>
      <parent>XWiki.WebHome</parent>
      <creator>XWiki.Admin</creator>
      <author>XWiki.Admin</author>
      <customClass></customClass>
      

      TIA,

      R.

      1. Postgre8.4Migration.txt
        1.08 MB
        Sorin Burjan
      2. Postgres9.1.3Migration.txt
        185 kB
        Sorin Burjan

        Issue Links

          Activity

          Hide
          H.-Dirk Schmitt added a comment -

          Problem has been reproduced here by upgrade 2 xwiki instances from 3.0 to 3.4.

          It can be solved by the allready mentioned solution:

          The solution is to add:

          <typedef name="materialized_clob" class="org.hibernate.type.StringClobType" />
          to the xwiki.hbm.xml file at the top (similar to what is done in xwiki.oracle.hbm.xml)

          Show
          H.-Dirk Schmitt added a comment - Problem has been reproduced here by upgrade 2 xwiki instances from 3.0 to 3.4. It can be solved by the allready mentioned solution: The solution is to add: <typedef name="materialized_clob" class="org.hibernate.type.StringClobType" /> to the xwiki.hbm.xml file at the top (similar to what is done in xwiki.oracle.hbm.xml)
          Hide
          Sergiu Dumitriu added a comment -

          Fixed in eeac01a

          Show
          Sergiu Dumitriu added a comment - Fixed in eeac01a
          Hide
          Vincent Massol added a comment -

          Reopening because Sorin found it's not working

          Show
          Vincent Massol added a comment - Reopening because Sorin found it's not working
          Hide
          Sorin Burjan added a comment -

          Tested migrations and fail:

          • from 2.7.2 to 3.5 snapshot (xwiki-enterprise-jetty-hsqldb-3.5-20120403.212339-142.zip) on Postgres 8.4.10, Ubuntu 11.04 32 bit (from official repo), JDBC Driver: postgresql-9.1-901.jdbc4.jar
            • start with a blank 2.7.2, import 2.7.2 XAR, added some attachments and stop 2.7.2
            • start the 3.5 instance, it fails during the first access. I didn't get to the 3.5 import XAR (see Postgre8.4Migration.txt)
          • from 2.7.2 to 3.5 snapshot (xwiki-enterprise-jetty-hsqldb-3.5-20120403.212339-142.zip) on Postgres 9.1.3, Ubuntu 11.04 32 bit the installer from Postgres site, JDBC Driver: postgresql-9.1-901.jdbc4.jar
            • start with a blank 2.7.2, import 2.7.2 XAR, added some attachments and stop 2.7.2
            • start the 3.5 instance, it fails during the first access. I didn't get to the 3.5 import XAR (see Postgre9.1.3Migration.txt)
          Show
          Sorin Burjan added a comment - Tested migrations and fail: from 2.7.2 to 3.5 snapshot (xwiki-enterprise-jetty-hsqldb-3.5-20120403.212339-142.zip) on Postgres 8.4.10, Ubuntu 11.04 32 bit (from official repo), JDBC Driver: postgresql-9.1-901.jdbc4.jar start with a blank 2.7.2, import 2.7.2 XAR, added some attachments and stop 2.7.2 start the 3.5 instance, it fails during the first access. I didn't get to the 3.5 import XAR (see Postgre8.4Migration.txt) from 2.7.2 to 3.5 snapshot (xwiki-enterprise-jetty-hsqldb-3.5-20120403.212339-142.zip) on Postgres 9.1.3, Ubuntu 11.04 32 bit the installer from Postgres site, JDBC Driver: postgresql-9.1-901.jdbc4.jar start with a blank 2.7.2, import 2.7.2 XAR, added some attachments and stop 2.7.2 start the 3.5 instance, it fails during the first access. I didn't get to the 3.5 import XAR (see Postgre9.1.3Migration.txt)
          Hide
          Sergiu Dumitriu added a comment -

          Fixed the 3.5.1 issue in a6d7f9e

          Show
          Sergiu Dumitriu added a comment - Fixed the 3.5.1 issue in a6d7f9e

            People

            • Assignee:
              Sergiu Dumitriu
              Reporter:
              H.-Dirk Schmitt
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: