Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2074

Database Migration fails when migrating from 1.0 or older directly to 1.2 without going through a 1.1 upgrade

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.2.2, 1.3 M2
    • 1.2.1, 1.3 M1
    • Storage
    • None

    Description

      The error you get is:

      2008-02-05 22:25:29,337 [http://localhost:8081/xwiki/bin/view/Main/WebHome] [http-8081-1] INFO  .AbstractXWikiMigrationManager  - Running migration [R4359XWIKI1459] with version [4359] 
      2008-02-05 22:25:29,543 [http://localhost:8081/xwiki/bin/view/Main/WebHome] [http-8081-1] INFO  bernate.R4359XWIKI1459Migrator  - Updating document [XWiki.ArticleClass]... 
      2008-02-05 22:25:31,136 [http://localhost:8081/xwiki/bin/view/Main/WebHome] [http-8081-1] INFO  .AbstractXWikiMigrationManager  - Failed to migrate database [jguard]... 
      com.xpn.xwiki.XWikiException: Error number 3005 in 3: Migration failed
      Wrapped Exception: Error number 3005 in 3: R4359XWIKI1459 migration failed
      Wrapped Exception: Data truncation: Column was set to data type implicit default; NULL supplied for NOT NULL column 'XWD_ARCHIVE' at row 1
      	at com.xpn.xwiki.store.migration.AbstractXWikiMigrationManager.startMigrationsForDatabase(AbstractXWikiMigrationManager.java:179)
      	at com.xpn.xwiki.store.migration.AbstractXWikiMigrationManager.startMigrations(AbstractXWikiMigrationManager.java:124)
      	at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:721)
      	at com.xpn.xwiki.XWiki.<init>(XWiki.java:672)
      	at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:241)
      	at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:439)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:94)
      	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.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
      	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:233)
      	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:102)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      	at java.lang.Thread.run(Thread.java:619)
      
      
      Wrapped Exception:
      
      
      com.xpn.xwiki.XWikiException: Error number 3005 in 3: R4359XWIKI1459 migration failed
      Wrapped Exception: Data truncation: Column was set to data type implicit default; NULL supplied for NOT NULL column 'XWD_ARCHIVE' at row 1
      	at com.xpn.xwiki.store.migration.hibernate.R4359XWIKI1459Migrator$1.doInHibernate(R4359XWIKI1459Migrator.java:120)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:918)
      

      This because in pre-1.0 DB the XWD_ARCHIVE had a not null constraints with was updated to 'null allowed' in 1.1 but since that column has disappeared in the 1.2 schema Hibernate doesn't update the contraint... (thanks to Sergiu for figuring this out).

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: