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

Deleting and recreating a subwiki does not work (throws exception)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • None
    • 3.5, 4.0-rc-1
    • Old Core
    • None
    • Unknown

    Description

      To reproduce, in a multiwiki instance:

      • create a subwiki (I used WikiManager.CreateNewWiki but I don't think workspaces changes anything)
      • delete it
      • re-create the same subwiki: you won't be able to complete, you'll get an error.
        The exception is something like this
        La création du wiki "wikitemplate" a échoué : Error number 50035 in 5: Exception in plugin xpn.xwiki.plugin.wikimanager.Wiki Manager Plugin?: Wiki wikitemplate? database update failed Wrapped Exception: Error number 3202 in 3: Exception while reading document name = [XWiki Preferences?, type = DOCUMENT?, parent = name = [XWiki?, type = SPACE?, parent = name = [wikitemplate?, type = WIKI?, parent = null?]]] Wrapped Exception: could not load an entity: xpn.xwiki.doc.XWiki Document?.
        

        and in the logs there is something like this

        2012-04-30 15:42:11,057 [http://localhost:8080/xwiki/bin/view/WikiManager/CreateNewWiki?wikiname=wikitemplate&XWiki.XWikiServerClass_0_wikiprettyname=Wikitemplate&XWiki.XWikiServerClass_0_description=Template+de+wiki&XWiki.XWikiServerClass_0_server=wikitemplate&XWiki.XWikiServerClass_0_owner=XWiki.Admin&XWiki.XWikiServerClass_0_owner=&form_token=xzmqd1ltxjjhsN56v4ccLw&actioncreate=Cr%C3%A9er] ERROR o.h.u.JDBCExceptionReporter    - Table 'wikitemplate.xwikidoc' doesn't exist 
        

      This is caused because the subwiki database schema is not initialized, so initializeXWikiClasses() which is done upon creation of the subwiki, is trying to get a table which doesn't exist.

      The reason for which the subwiki schema is not initialized is because, in the function

      com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase()

      , where a new database should be initialized, the newly re-created wiki fails to be seen as new database, because of the database version cache. The function com.xpn.xwiki.store.migration.AbstractDataMigrationManager.getDBVersion() will get the version of the wikitemplate database from the cache, and will think it's great and up to date. The fix would be to clear this cache when a subwiki is deleted.

      Note that, of course, since this it's a cache issue, a server restart between the delete and the re-create will work perfectly fine as a workaround.

      Attachments

        Issue Links

          Activity

            People

              enygma Eduard Moraru
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: