Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3202

Problems with old extensions during restore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • Extension
    • None
    • Unknown

    Description

      Hello,

      I'm in the progress of migrating from a debian 11 with tomcat to a debian 12 with jetty and I'm struggling with the restore. Or better I was struggling. So this here is more a question than a bug-report. I wanted to write this into the forum, but I'm getting no mails from the xwiki-forum-server for password reset or login-link

      After restoring (DB+dataDirectory+config) I got many warnings and errors and funny behaviour in general. See this example:

      2024-11-15 09:41:45,950 [main] WARN  .e.r.i.l.LocalExtensionStorage - Failed to load extension from file [/var/lib/xwiki/data/extension/repository/org%2Exwiki%2Eplatform%3Axwiki-platform-image-lightbox-ui/14%2E8/org%2Exwiki%2Eplatform%3Axwiki-platform-image-lightbox-ui-14%2E8.xed] in local repository
      org.xwiki.extension.InvalidExtensionException: Failed to parse descriptor
              at org.xwiki.extension.repository.internal.DefaultExtensionSerializer.getExtensionElement(DefaultExtensionSerializer.java:298)
              at org.xwiki.extension.repository.internal.DefaultExtensionSerializer.loadLocalExtensionDescriptor(DefaultExtensionSerializer.java:275)
              at org.xwiki.extension.repository.internal.local.LocalExtensionStorage.loadDescriptor(LocalExtensionStorage.java:171)
              at org.xwiki.extension.repository.internal.local.LocalExtensionStorage.loadExtensions(LocalExtensionStorage.java:143)
              at org.xwiki.extension.repository.internal.local.LocalExtensionStorage.loadExtensions(LocalExtensionStorage.java:140)
              at org.xwiki.extension.repository.internal.local.LocalExtensionStorage.loadExtensions(LocalExtensionStorage.java:140)
              at org.xwiki.extension.repository.internal.local.LocalExtensionStorage.loadExtensions(LocalExtensionStorage.java:112)
              at org.xwiki.extension.repository.internal.local.DefaultLocalExtensionRepository.initialize(DefaultLocalExtensionRepository.java:108)
              at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:550)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
              at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
              at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:290)
              at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:116)
              at org.eclipse.jetty.ee8.nested.ContextHandler.callContextInitialized(ContextHandler.java:782)
              at org.eclipse.jetty.ee8.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:516)
              at org.eclipse.jetty.ee8.nested.ContextHandler.contextInitialized(ContextHandler.java:731)
              at org.eclipse.jetty.ee8.servlet.ServletHandler.initialize(ServletHandler.java:629)
              at org.eclipse.jetty.ee8.servlet.ServletContextHandler.startContext(ServletContextHandler.java:311)
              at org.eclipse.jetty.ee8.webapp.WebAppContext.startWebapp(WebAppContext.java:1195)
              at org.eclipse.jetty.ee8.webapp.WebAppContext.startContext(WebAppContext.java:1165)
              at org.eclipse.jetty.ee8.nested.ContextHandler.doStartInContext(ContextHandler.java:622)
              at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1440)
              at org.eclipse.jetty.ee8.nested.ContextHandler.doStart(ContextHandler.java:611)
              at org.eclipse.jetty.ee8.servlet.ServletContextHandler.doStart(ServletContextHandler.java:243)
              at org.eclipse.jetty.ee8.webapp.WebAppContext.doStart(WebAppContext.java:502)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
              at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491)
              at org.eclipse.jetty.server.handler.ContextHandler.lambda$doStart$0(ContextHandler.java:754)
              at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1446)
              at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:754)
              at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler.doStart(ContextHandler.java:2259)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:40)
              at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
              at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:522)
              at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:162)
              at org.eclipse.jetty.deploy.providers.ScanningAppProvider.pathAdded(ScanningAppProvider.java:293)
              at org.eclipse.jetty.deploy.providers.ContextProvider.pathAdded(ContextProvider.java:576)
              at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.pathAdded(ScanningAppProvider.java:69)
              at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:902)
              at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:868)
              at org.eclipse.jetty.util.Scanner.scan(Scanner.java:775)
              at org.eclipse.jetty.util.Scanner.startScanning(Scanner.java:664)
              at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:636)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120)
              at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:264)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:592)
              at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:263)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
              at org.eclipse.jetty.server.Server.start(Server.java:624)
              at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120)
              at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491)
              at org.eclipse.jetty.server.Server.doStart(Server.java:565)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
              at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:2033)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:569)
              at org.eclipse.jetty.start.Main.invokeMain(Main.java:312)
              at org.eclipse.jetty.start.Main.start(Main.java:610)
              at org.eclipse.jetty.start.Main.main(Main.java:82)
      Caused by: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
              at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
              at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
              at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
              at org.xwiki.extension.repository.internal.DefaultExtensionSerializer.getExtensionElement(DefaultExtensionSerializer.java:296)
              ... 79 common frames omitted
       

       

      Here the content of this directory on the old server for this extension I included from the log above (the same for the other extensions)

       l /var/lib/xwiki/data/extension/repository/org%2Exwiki%2Eplatform%3Axwiki-platform-image-lightbox-ui/
      total 136
      drwxr-x---  29 tomcat tomcat  4096 Nov 12 08:29 .
      drwxr-x--- 264 tomcat tomcat 24576 Oct 21 11:34 ..
      drwxr-x---   2 tomcat tomcat  4096 Mar  1  2022 14%2E1
      drwxr-x---   2 tomcat tomcat  4096 Dec  2  2022 14%2E10
      drwxr-x---   2 tomcat tomcat  4096 Jan 27  2023 14%2E10%2E3
      drwxr-x---   2 tomcat tomcat  4096 Apr  5  2022 14%2E2%2E1
      drwxr-x---   2 tomcat tomcat  4096 Jun  3  2022 14%2E4
      drwxr-x---   2 tomcat tomcat  4096 Jul 12  2022 14%2E5
      drwxr-x---   2 tomcat tomcat  4096 Aug  1  2022 14%2E6
      drwxr-x---   2 tomcat tomcat  4096 Sep 13  2022 14%2E7
      drwxr-x---   2 tomcat tomcat  4096 Oct 19  2022 14%2E8
      drwxr-x---   2 tomcat tomcat  4096 Feb  6  2023 15%2E0
      drwxr-x---   2 tomcat tomcat  4096 Mar 13  2023 15%2E1
      drwxr-x---   2 tomcat tomcat  4096 Nov 30  2023 15%2E10
      drwxr-x---   2 tomcat tomcat  4096 Jan 24  2024 15%2E10%2E5
      drwxr-x---   2 tomcat tomcat  4096 Apr 11  2023 15%2E2
      drwxr-x---   2 tomcat tomcat  4096 Apr 25  2023 15%2E3
      drwxr-x---   2 tomcat tomcat  4096 May 31  2023 15%2E4
      drwxr-x---   2 tomcat tomcat  4096 Jun 29  2023 15%2E5
      drwxr-x---   2 tomcat tomcat  4096 Aug  7  2023 15%2E6
      drwxr-x---   2 tomcat tomcat  4096 Sep 20  2023 15%2E7
      drwxr-x---   2 tomcat tomcat  4096 Oct  2  2023 15%2E8
      drwxr-x---   2 tomcat tomcat  4096 Nov  9  2023 15%2E9
      drwxr-x---   2 tomcat tomcat  4096 Mar  4  2024 16%2E1%2E0
      drwxr-x---   2 tomcat tomcat  4096 Apr 12  2024 16%2E2%2E0
      drwxr-x---   2 tomcat tomcat  4096 May 15  2024 16%2E3%2E1
      drwxr-x---   2 tomcat tomcat  4096 Jul  1 06:37 16%2E5%2E0
      drwxr-x---   2 tomcat tomcat  4096 Sep 10 11:57 16%2E7%2E1
      drwxr-x---   2 tomcat tomcat  4096 Nov 12 08:29 16%2E9%2E0
       

      There are all versions since version my xwiki-install

       

      My solution is by preparing the data from the backup with the following lines:

      7zz x  xwikiData.7z.001 -oxwikiData -y
      rm -rf xwikiData/xwiki/data/cache/
      rm -rf xwikiData/xwiki/data/store/solr/
      find xwikiData/xwiki/data/extension/repository -type d -name "13%2E*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "13%2E*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "14%2E*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "15%2E*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E1*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E2*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E3*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E4*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E5*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E6*" -exec rm -rf {} 2> /dev/null \;
      find xwikiData/xwiki/data/extension/repository -type d -name "16%2E7*" -exec rm -rf {} 2> /dev/null \;

       

      So I removed all old extensions but the latest 16.9.0 (from the new server) :

      l /var/lib/xwiki/data/extension/repository/org%2Exwiki%2Eplatform%3Axwiki-platform-image-lightbox-ui/
      total 36
      drwxr-x---   3 xwiki xwiki  4096 Nov 15 11:34 .
      drwxr-x--- 264 xwiki xwiki 28672 Oct 21 11:34 ..
      drwxr-x---   2 xwiki xwiki  4096 Nov 12 08:29 16%2E9%2E0 

      A start of xwiki results then in a error and warning free starting.

      (deleting the solr directory removed one other error/warning source which I cannot find anymore in the log files)

       

      I have a working solution, but why did I have to do this? And did I something which will bring me into troubles some day?

       

      I tried to follow https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Backup but the restore-part there is not very clear for me. 
      Also if the ROOT.tar.gz in the example backup-script there is my /usr/lib/xwiki where the WEB-INF is located. But I found out, that there is nothing, which I have to restore from /usr/lib/xwiki for a working xwiki.

      My complete restore progress of my tomcat backup:

      • apt install xwiki-xjetty-mariadb
      • stop xwiki
      • restore sql from main-wiki and subwikis
      • replace the /var/lib/xwiki/data/ with the one from the backup
        • without cache and solr
        • without old extensions
      • start xwiki

       

      All config files are unchanged except plantuml-server-url, LDAP and two mods for a working nginx redirect.

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Steinmassl Josef Steinmaßl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: