Upgrade from 16.1 to 16.2 or 16.3 failing

Running 16.1 on Debian 12 without issues. But the upgrade to 16.2 or now 16.3 fails. Reverting back to 16.1 works fine. All the extensions are up-to-date. Not sure what to do next. There are errors (below) but I’m not sure what to make of them.
Packages:
ii xwiki-common 16.1.0
ii xwiki-mariadb-common 16.1.0
ii xwiki-xjetty-common 16.1.0
ii xwiki-xjetty-mariadb 16.1.0

Extract from logs after the upgrade:
May 24 19:48:51 mcclung systemd[1]: Started xwiki.service - XWiki Jetty Application Server.
May 24 19:48:52 mcclung xwiki[1776790]: 2024-05-24 19:48:52.667:INFO :oxtjl.NotifyListener:main: Starting Jetty on port 8080, on Java 17.0.11+9-Debian-1deb12u1 (OpenJDK Runtime Environment)…
May 24 19:48:53 mcclung xwiki[1776790]: 2024-05-24 19:48:53.332:WARN :oejsh.AllowSymLinkAliasChecker:main: Deprecated, use SymlinkAllowedResourceAliasChecker instead.
May 24 19:48:56 mcclung xwiki[1776790]: 2024-05-24 19:48:56,045 [main] INFO iPropertiesConfigurationSource - Loading [xwiki.properties] from default location [/etc/xwiki/xwiki.properties]
May 24 19:48:56 mcclung xwiki[1776790]: 2024-05-24 19:48:56,199 [main] INFO o.x.e.i.ServletEnvironment - Using permanent directory [/var/lib/xwiki/data]
May 24 19:48:59 mcclung xwiki[1776790]: 2024-05-24 19:48:59,945 [main] WARN ltInstalledExtensionRepository - Invalid extension [com.xwiki.confluencepro:application-confluence-migrator-pro-ui/1.19.1] on namespace [wiki:xwiki] (InvalidExtensionException: No compatible extension is installed for dep
endency [javax.ws.rs:jsr311-api-1.1.1])
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,010 [main] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki/16.1.0] on namespace [wiki:xwiki] (InvalidExtensionException: Dependency [org.xwiki.platform:xwiki-platfor
m-oldcore-[16.1.0]] is incompatible with the core extension [org.xwiki.platform:xwiki-platform-legacy-oldcore/16.2.0])
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,018 [main] WARN ltInstalledExtensionRepository - Invalid extension [com.xwiki.task:application-task-ui/3.4.1] on namespace [wiki:xwiki] (InvalidExtensionException: No compatible extension is installed for dependency [javax.ws.rs:jsr311-a
pi-1.1.1])
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,019 [main] WARN ltInstalledExtensionRepository - Invalid extension [com.xwiki.task:application-task-default/3.4.1] (InvalidExtensionException: No compatible extension is installed for dependency [javax.ws.rs:jsr311-api-1.1.1])
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,022 [main] WARN ltInstalledExtensionRepository - Invalid extension [com.xwiki.confluencepro:application-confluence-migrator-pro-default/1.19.1] (InvalidExtensionException: No compatible extension is installed for dependency [javax.ws.rs:
jsr311-api-1.1.1])
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,022 [main] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.contrib:authservice-backport-api/1.1.1] (InvalidExtensionException: Extension [org.xwiki.contrib:authservice-backport-api/1.1.1] already exists as a core exten
sion)
May 24 19:49:00 mcclung xwiki[1776790]: 2024-05-24 19:49:00,023 [main] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.platform:xwiki-platform-image-style-rest/16.1.0] (InvalidExtensionException: No compatible extension is installed for dependency [javax.ws.rs:jsr311-api-1.1.1]
)
May 24 19:49:01 mcclung xwiki[1776790]: 2024-05-24 19:49:01,110 [main] WARN .i.DefaultExtensionInitializer - Failed to initialize dependency [org.xwiki.platform:xwiki-platform-image-style-rest-16.1.0]: ExtensionException: Extension [org.xwiki.platform:xwiki-platform-image-style-ui/16.1.0] cannot
be initialized because its dependency ([org.xwiki.platform:xwiki-platform-image-style-rest-16.1.0]) could not.
May 24 19:49:01 mcclung xwiki[1776790]: 2024-05-24 19:49:01,308 [main] ERROR .i.DefaultExtensionInitializer - Failed to initialize local extension [org.xwiki.platform:xwiki-platform-export-pdf-default/16.1.0]
May 24 19:49:01 mcclung xwiki[1776790]: org.xwiki.extension.ExtensionException: Failed to initialize dependency [org.xwiki.platform:xwiki-platform-export-pdf-api-16.1.0]
May 24 19:49:01 mcclung xwiki[1776790]: #011at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionDependencyInNamespace(DefaultExtensionInitializer.java:216)

May 24 19:49:01 mcclung xwiki[1776790]: Caused by: java.lang.ClassNotFoundException: org.xwiki.script.internal.safe.ScriptSafeProvider
May 24 19:49:01 mcclung xwiki[1776790]: #011at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
May 24 19:49:01 mcclung xwiki[1776790]: #011at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
May 24 19:49:01 mcclung xwiki[1776790]: #011at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
May 24 19:49:01 mcclung xwiki[1776790]: #011… 77 common frames omitted
May 24 19:49:01 mcclung xwiki[1776790]: 2024-05-24 19:49:01,310 [main] ERROR .i.DefaultExtensionInitializer - Failed to initialize local extension [org.xwiki.platform:xwiki-platform-export-pdf-ui/16.1.0]
May 24 19:49:01 mcclung xwiki[1776790]: org.xwiki.extension.ExtensionException: Failed to initialize dependency [org.xwiki.platform:xwiki-platform-export-pdf-default-16.1.0]
May 24 19:49:01 mcclung xwiki[1776790]: #011at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionDependencyInNamespace(DefaultExtensionInitializer.java:216)

May 24 19:49:01 mcclung xwiki[1776790]: Caused by: org.xwiki.extension.ExtensionException: Extension [org.xwiki.platform:xwiki-platform-export-pdf-ui/16.1.0] cannot be initialized because its dependency ([org.xwiki.platform:xwiki-platform-export-pdf-default-16.1.0]) could not.
May 24 19:49:01 mcclung xwiki[1776790]: #011at org.xwiki.extension.handler.internal.DefaultExtensionInitializer.initializeExtensionDependencyInNamespace(DefaultExtensionInitializer.java:207)
May 24 19:49:01 mcclung xwiki[1776790]: #011… 57 common frames omitted
May 24 19:49:02 mcclung xwiki[1776790]: 2024-05-24 19:49:02,714 [main] INFO o.x.s.s.i.EmbeddedSolr - Updating Solr home directory at [/var/lib/xwiki/data/store/solr]
May 24 19:49:02 mcclung xwiki[1776790]: 2024-05-24 19:49:02,726 [main] INFO o.x.s.s.i.EmbeddedSolr - Starting embedded Solr server…
May 24 19:49:02 mcclung xwiki[1776790]: 2024-05-24 19:49:02,726 [main] INFO o.x.s.s.i.EmbeddedSolr - Using Solr home directory: [/var/lib/xwiki/data/store/solr]
May 24 19:49:03 mcclung xwiki[1776790]: 2024-05-24 19:49:03,472 [main] WARN o.a.s.c.CoreContainer - Not all security plugins configured! authentication=disabled authorization=disabled. Solr is only as secure as you make it. Consider configuring authentication/authorization before expos
ing Solr to users internal or external. See Securing Solr :: Apache Solr Reference Guide for more info
May 24 19:49:05 mcclung xwiki[1776790]: 2024-05-24 19:49:05,698 [main] INFO o.x.s.s.i.EmbeddedSolr - Started embedded Solr server.
May 24 19:49:05 mcclung xwiki[1776790]: 2024-05-24 19:49:05,704 [main] INFO o.x.s.f.i.FilesystemStoreTools - Using filesystem store directory [/home/xwiki/data/store/file]
May 24 19:49:06 mcclung xwiki[1776790]: 2024-05-24 19:49:06.845:WARN :oejs.BaseHolder:main: Unable to load class org.xwiki.rest.internal.XWikiRestletServlet
May 24 19:49:06 mcclung xwiki[1776790]: java.lang.ClassNotFoundException: org.xwiki.rest.internal.XWikiRestletServlet
May 24 19:49:06 mcclung xwiki[1776790]: #011at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
May 24 19:49:06 mcclung xwiki[1776790]: 2024-05-24 19:49:06.852:WARN :oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@7d9e8ef7{XWiki,/xwiki,file:///usr/lib/xwiki/,UNAVAILABLE}{/usr/lib/xwiki}
May 24 19:49:06 mcclung xwiki[1776790]: javax.servlet.UnavailableException: Class loading error for holder RestletServlet==org.xwiki.rest.internal.XWikiRestletServlet@d8aab29e{jsp=null,order=-1,inst=false,async=false,src=DESCRIPTOR:file:///usr/lib/xwiki/WEB-INF/web.xml,STARTING}
May 24 19:49:06 mcclung xwiki[1776790]: #011at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:104)

Any ideas?
Thanks!

This seems to be the blocker here.

To me it feels like you have some customization in /etc/xwiki/web.xml which caused a bad merge during the apt upgrade. In standard the current version is supposed to look like xwiki-platform/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/web.xml at master · xwiki/xwiki-platform · GitHub.

1 Like

Thank you Mr. Mortagne, perhaps unwittingly you solved my issue: REST calls return 404 after upgrade to 16.2 with short URL's

So from me to you, by way of showing my utmost gratitude, a well deserved delicacy :slight_smile:

2 Likes

Thank you tmortagne, that was it. I haven’t done any customizations, so I’m not sure how the it got to be RestletServlet instead of RESTServlet but changing those to match the linked web.xml fixed it.

I had the same troubles as you did, so I revived a snapshot and did the upgrade again and paid close attention to how I got into the trouble.

It appears that it is not possible to do a merge of the files during upgrade because of a conflict issue:
merge-conflict

I tried to opt with the start a new shell option, but this failed:
new-shell-nono

In the end I just was forced to either keep my original files or replace it all with the upgraded version. I chose for “out with the old, in with the new.”

I am currently running XWiki on a Debian VPS via Proxmox. The console window is of the QEMU persuasion.

And you did customize the web.xml file, right ?

ucf (what is in charge of the merge) conflict resolution features are indeed quite limited to say the least… In such case I generally note down customization I made using the diff, choose the standard version and apply again the customizations (at least those which are still needed) manually after the upgrade.

I did customize the web.xml file but only for short URLs (so the change from “/bin/*” to “/*” at the height of the RESTful API mapping part). There were more differences between the two versions but I guess you know about that because of the change to Jersey.

What you said is exactly what I did but I only had to customize the short URL part, of which I know now by heart :wink: