Upgrade from Xwiki 16.10.2 on Tomcat 9 to XWiki 17.2.0; box running Ubuntu 22.04

Hi! I had a running XWiki 16.10.2 - Tomcat 9 running on an Ubuntu 22.04 box.

Here what I had before trying to update to XWiki 17.2.0:

rjr@e220i057h096l:~$ lsb_release  -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy
rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
ii  xwiki-common                                     16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-mysql-common                               16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rjr@e220i057h096l:~$ apt list --upgradable
Listing... Done
xwiki-common/stable 17.2.0 all [upgradable from: 16.10.2]
xwiki-mysql-common/stable 17.2.0 all [upgradable from: 16.10.2]
xwiki-tomcat9-common/stable 16.10.5 all [upgradable from: 16.10.2]
xwiki-tomcat9-mysql/stable 16.10.5 all [upgradable from: 16.10.2]
rjr@e220i057h096l:~$ 

Doing my best to follow the upgrading instructions, I did:

sudo systemctl stop tomcat9
sudo apt remove tomcat9
sudo apt upgrade

Now, I get:

rjr@e220i057h096l:~$ apt list --upgradable
Listing... Done
rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
ii  xwiki-common                                     17.2.0                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-mysql-common                               17.2.0                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rjr@e220i057h096l:~$ sudo apt upgrade
[sudo] password for rjr: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common libtcnative-1 xwiki-common xwiki-mysql-common
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
rjr@e220i057h096l:~$ 

After removing Tomcat9, no updated Tomcat was installed. I’m afraid I misunderstood the instructions. If I try to install xwiki-tomcat10-mariadb or xwiki-tomcat10-common, I get:

rjr@e220i057h096l:~$ sudo apt install xwiki-tomcat10-mariadb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xwiki-tomcat10-common : Depends: tomcat10 but it is not installable
E: Unable to correct problems, you have held broken packages.
rjr@e220i057h096l:~$ sudo apt install xwiki-tomcat10-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xwiki-tomcat10-common : Depends: tomcat10 but it is not installable
E: Unable to correct problems, you have held broken packages.
rjr@e220i057h096l:~$ 

Must I manually install Tomcat10 and try to install xwiki-tomcat10-common and xwiki-tomcat10-mariadb once I have it working?

Thanks!

This is because there is no tomcat10 package available in Ubuntu 22.04 repositories, according to https://launchpad.net/ubuntu/+source/tomcat10. You will need to upgrade the system too (for example to 24.04 which is the current LTS).

I updated the documentation to make it a bit more obvious that if you uninstall an old package, you need to install the new one (which you eventually tried anyway).

Thanks, Thomas.

As would like to stick with Ubuntu 22.04 by now to avoid issues with other applications running on the concerned box, I installed manually Tomcat 10 as per the instructions available here.

I got a running new Tomcat 10 instance:

[rjr@e220i058h024l ~]$ curl -sL 172.16.57.96:8080 | grep -o -P '(?<=<title>).*(?=</title>)'
Apache Tomcat/10.1.40
[rjr@e220i058h024l ~]$ 

XWiki is not available yet, but I would expect nothing different as there as still missing components and, for sure, fine tune settings.

Following the change you introduced a while ago on Upgrading, I tried:

rjr@e220i057h096l:~$ sudo apt install xwiki-tomcat10-mariadb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xwiki-tomcat10-common : Depends: tomcat10 but it is not installable
E: Unable to correct problems, you have held broken packages.
rjr@e220i057h096l:~$ 

Thus, is it no possible to stick with Ubuntu 22.04 to get back an updated to release 17 XWiki instance?

Thanks!

The XWiki Debian xwiki-tomcat10-* packages are designed to expect tomcat10 as a dependency package, so it won’t work.

The alternatives are:

  • move to xjetty packages (so an embedded custom Jetty, instead of a Tomcat dependency)
  • if you want to keep using Tomcat, but you don’t need any fancy new feature, the simplest would probably be to use the lts repository (so XWiki 16.10.x, which is using Tomcat 9) instead of the stable one, until you are ready to move to Ubuntu 24.04 (but the XWiki LTS support will end at the end of the year)
  • install only xwiki-common-mariadb (or some other database flavor) and re-do manually what xwiki-tomcat10-commons does (which is mostly put this file in the right location) so that Tomcat know where XWiki is located
  • of course, you could also use one of the non-debian specific ways of installing XWiki (WAR, Docker)

I will go for these for a number of reasons. I can not update now to Ubuntu 24.04, had issues with the attempts to go for Docker, know the WAR procedure, I prefer to stick with Tomcat as I’m starting to understand something about it! Furthermore, I think I will survive with some help from you! Thanks in advance.

Going that way, am I done with the installation of DEB modules if I see:

rjr@e220i057h096l:~$ mysql -V
mysql  Ver 8.0.41-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))
rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
ii  xwiki-common                                     17.2.1                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-mysql-common                               17.2.1                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis

You talked about xwiki-tomcat10-commons. What about xwiki-tomcat10-mysql?

Thank you very much!

Sorry, I meant xwiki-mariadb-common (there is no such thing as xwiki-common-mariadb).

The main point of xwiki-tomcat10-mysql is to be an entry point triggering the right dependencies when you want both Tomcat 10 (so xwiki-tomcat10-commons) and MySQL (so xwiki-mysql-common).

So in your case, you should only install xwiki-mysql-common (which triggers as dependency xwiki-common), which you probably already have (so I guess it’s more about upgrading it). And then tell the Tomcat 10 you installed by hand where the XWiki application is located.

Hi! Although I’m still failing at getting my old XWiki running, I managed to install a new XWiki Debian 17.2.1 on an old iMac running Ubuntu 24.04. I’m learning a lot!

Something I’m missing, but I’m not able to find what is it. Thomas, following your statement…

… and by reading Tomcat 10 manual about Contexts and Deployment, and comparing my Tomcat 10 on Ubuntu 22.04 manual installation (CATALINA_BASE: /opt/tomcat; installed as said above) with the running one on Ubuntu 24.04 (installed from XWiki repositories as it reads the documentation), I concluded that I have two alternatives to add /xwiki Context/Application to the application server:

mkdir -p /opt/tomcat/webapps/xwiki/META-INF
cd /opt/tomcat/webapps/xwiki/META-INF
wget https://raw.githubusercontent.com/xwiki/xwiki-platform/refs/heads/master/xwiki-platform-distribution/xwiki-platform-distribution-debian/xwiki-platform-distribution-debian-tomcat/xwiki-platform-distribution-debian-tomcat10/xwiki-platform-distribution-debian-tomcat10-common/src/deb/resources/etc/xwiki/xwiki-tomcat10.xml
mv xwiki-tomcat10.xml context.xml

or

cd /opt/tomcat/conf/Catalina/localhost/
wget https://raw.githubusercontent.com/xwiki/xwiki-platform/refs/heads/master/xwiki-platform-distribution/xwiki-platform-distribution-debian/xwiki-platform-distribution-debian-tomcat/xwiki-platform-distribution-debian-tomcat10/xwiki-platform-distribution-debian-tomcat10-common/src/deb/resources/etc/xwiki/xwiki-tomcat10.xml
mv xwiki-tomcat10.xml xwiki.xml

Neither the first, nor the second, worked for me.

If I create context.xml under /opt/tomcat/webapps/xwiki/META-INF, Tomcat 10 detects the changes and deploy/undeploy /xwiki context accordingly:

18-Apr-2025 12:45:25.008 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/xwiki]
18-Apr-2025 12:45:25.031 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/xwiki] has finished in [23] ms
18-Apr-2025 12:46:55.549 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/xwiki]

But the application is not available:

I clearly see that it is an incomplete deployment, thus I didn’t expect a running /xwiki application.

If I create xwiki.xml under /opt/tomcat/conf/Catalina/localhost/, Tomcat 10 also detects changes and, I get:

18-Apr-2025 13:26:47.075 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/tomcat/conf/Catalina/localhost/xwiki.xml]
18-Apr-2025 13:26:47.077 WARNING [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/xwiki] in deployment descriptor [/opt/tomcat/conf/Catalina/localhost/xwiki.xml] has been ignored
18-Apr-2025 13:26:49.154 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
18-Apr-2025 13:26:49.155 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal Context [/xwiki] startup failed due to previous errors
18-Apr-2025 13:26:49.165 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/opt/tomcat/conf/Catalina/localhost/xwiki.xml] has finished in [2,090] ms

It seems that the path attribute is no longer required, but this is not for sure the issue here. I don’t know where to find that appropriate container log file.

What I find under /usr/lib/xwiki/ is apparently the same I find in my test machine (it is an old iMac with only 4Gb RAM) running Ubuntu 24.04:

root@e220i057h096l:~# ls -la /usr/lib/xwiki/
total 56
drwxr-xr-x   7 root root  4096 abr 14 16:11 .
drwxr-xr-x 137 root root 12288 abr 14 16:11 ..
drwxr-xr-x   3 root root  4096 abr 14 16:11 META-INF
-rw-r--r--   1 root root    96 abr 14 12:08 redirect
drwxr-xr-x   6 root root  4096 oct  5  2023 resources
drwxr-xr-x   3 root root  4096 oct  5  2023 skins
drwxr-xr-x  10 root root 20480 abr 14 16:11 templates
drwxr-xr-x   4 root root  4096 abr 14 16:11 WEB-INF
root@e220i057h096l:~#

I’m able to find only one difference: there is one file related with the old tomcat9.service that contents one section I’ve not found in Tomcat 10 service. It is the file /etc/systemd/system/tomcat9.service.d/xwiki-tomcat9-systemd.conf containing:

[Service]
# Need to allow Tomcat9 to read and write in XWiki permanent directory
ReadWritePaths=/var/lib/xwiki/data

Before messing up more things, I prefer to ask. Please, what I’m skipping or doing it wrong? Why although Tomcat 10 is detecting the changes I am not getting a complete XWiki deployment?

Thank you very much for your help!

This looks a lot like what the XWiki Debian package does.

But the following might do it too (it’s possible you don’t need a custom context with the standard Tomcat zip, not sure, the main thing it does is enabled following links, because the XWiki Debian package uses a lot of links):

ln -s /usr/lib/xwiki /opt/tomcat/webapps/xwiki

I never installed Tomcat by hand on Linux, so not sure, but I would expect to find it in one of the other files next to the one where from where you pasted the log above.

This is specific to the Debian package service. It has a protection to allow tomcat to access only to a specific list of location, so we have to add XWiki in there. But that should not be needed for your tomcat 10 installed by hand (even if you setup a systemd service with the same kind of protection, you can put XWiki stuff in there directly).

No way. I get the same message: /xwiki is not available. It doesn’t say that it doesn’t exist, but the deployment, if any, seems not correct.

18-Apr-2025 18:08:17.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/10.1.40
18-Apr-2025 18:08:17.188 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 1 2025 17:20:53 UTC
18-Apr-2025 18:08:17.189 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.1.40.0
18-Apr-2025 18:08:17.189 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
18-Apr-2025 18:08:17.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.8.0-57-generic
18-Apr-2025 18:08:17.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
18-Apr-2025 18:08:17.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-11-openjdk-amd64
18-Apr-2025 18:08:17.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.26+4-post-Ubuntu-1ubuntu122.04
18-Apr-2025 18:08:17.191 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Ubuntu
18-Apr-2025 18:08:17.191 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat
18-Apr-2025 18:08:17.191 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat
18-Apr-2025 18:08:17.219 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
18-Apr-2025 18:08:17.219 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Apr-2025 18:08:17.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
18-Apr-2025 18:08:17.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
18-Apr-2025 18:08:17.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsun.io.useCanonCaches=false
18-Apr-2025 18:08:17.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
18-Apr-2025 18:08:17.221 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
18-Apr-2025 18:08:17.221 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
18-Apr-2025 18:08:17.221 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
18-Apr-2025 18:08:17.221 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
18-Apr-2025 18:08:17.221 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024M
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
18-Apr-2025 18:08:17.222 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
18-Apr-2025 18:08:17.223 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
18-Apr-2025 18:08:17.228 SEVERE [main] org.apache.catalina.core.AprLifecycleListener.init An incompatible version [1.2.31] of the Apache Tomcat Native library is installed, while Tomcat requires version [1.2.34]
18-Apr-2025 18:08:17.758 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
18-Apr-2025 18:08:17.803 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [967] milliseconds
18-Apr-2025 18:08:17.876 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
18-Apr-2025 18:08:17.876 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.40]
18-Apr-2025 18:08:17.894 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
18-Apr-2025 18:08:18.721 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [826] ms
18-Apr-2025 18:08:18.722 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/xwiki]
18-Apr-2025 18:08:37.992 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/xwiki] has finished in [19,269] ms
18-Apr-2025 18:08:37.992 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
18-Apr-2025 18:08:38.020 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [28] ms
18-Apr-2025 18:08:38.020 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
18-Apr-2025 18:08:38.038 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [17] ms
18-Apr-2025 18:08:38.038 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
18-Apr-2025 18:08:38.064 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [25] ms
18-Apr-2025 18:08:38.064 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
18-Apr-2025 18:08:38.083 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [19] ms
18-Apr-2025 18:08:38.091 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
18-Apr-2025 18:08:38.116 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [20312] milliseconds
18-Apr-2025 18:29:38.497 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/sample.war]
18-Apr-2025 18:29:38.551 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/sample.war] has finished in [53] ms

Also, I changed ownership of all implied files to tomcat:tomcat to no avail.

I’m not able to find any useful information on log files, and I’m not able to find some instructions about how to debug this problem.

I download sample.war to /webapps and if worked without a glitch. I will give the WAR way a try: I truly need to get my XWiki back :frowning:

I will keep an eye on the DEB packages. Perhaps some notes in the update documentation are advisable to avoid others could get into troubles?

Thank you very much for your help! Any new ideas will be welcome!

Hi! I tried the WAR file and failed. Thus, I must have been failing in something very basic. And I found it! A wrong Java release was the culprit!

Firstly, the only alternative working for deploying in the manual Tomcat 10 installation is:

cd /opt/tomcat/conf/Catalina/localhost/
wget https://raw.githubusercontent.com/xwiki/xwiki-platform/refs/heads/master/xwiki-platform-distribution/xwiki-platform-distribution-debian/xwiki-platform-distribution-debian-tomcat/xwiki-platform-distribution-debian-tomcat10/xwiki-platform-distribution-debian-tomcat10-common/src/deb/resources/etc/xwiki/xwiki-tomcat10.xml
mv xwiki-tomcat10.xml xwiki.xml

Now, some details about the issue. See below the versions of Java installed in the box. I assumed that if XWiki 16.x.y was running on that server, Java can’t be an issue.

root@e220i057h096l:/usr/lib/jvm# ls -la
total 60
drwxr-xr-x   9 root root  4096 feb  6 06:13 .
drwxr-xr-x 137 root root 12288 abr 14 16:11 ..
lrwxrwxrwx   1 root root    25 mar 24  2022 bak-default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx   1 root root    34 feb  4  2024 default-java -> /usr/lib/jvm/java-18-openjdk-amd64
lrwxrwxrwx   1 root root    21 ago 25  2023 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
-rw-r--r--   1 root root  2047 ene 23 23:35 .java-1.11.0-openjdk-amd64.jinfo
lrwxrwxrwx   1 root root    21 oct 19  2023 java-1.17.0-openjdk-amd64 -> java-17-openjdk-amd64
-rw-r--r--   1 root root  1773 ene 25 02:06 .java-1.17.0-openjdk-amd64.jinfo
lrwxrwxrwx   1 root root    21 jul 22  2022 java-1.18.0-openjdk-amd64 -> java-18-openjdk-amd64
-rw-r--r--   1 root root  1840 jul 22  2022 .java-1.18.0-openjdk-amd64.jinfo
drwxr-xr-x   9 root root  4096 feb  6 06:12 java-11-openjdk-amd64
lrwxrwxrwx   1 root root    21 ene 17  2024 java-1.21.0-openjdk-amd64 -> java-21-openjdk-amd64
-rw-r--r--   1 root root  1840 ene 23 23:52 .java-1.21.0-openjdk-amd64.jinfo
drwxr-xr-x   7 root root  4096 feb  6 06:13 java-17-openjdk-amd64
drwxr-xr-x   9 root root  4096 oct  2  2023 java-18-openjdk-amd64
drwxr-xr-x   9 root root  4096 feb  6 06:13 java-21-openjdk-amd64
drwxr-xr-x   2 root root  4096 feb  6 06:12 openjdk-11
drwxr-xr-x   2 root root  4096 oct  2  2023 openjdk-18
drwxr-xr-x   2 root root  4096 feb  6 06:12 openjdk-21
root@e220i057h096l:/usr/lib/jvm#

But it happened that the manual installation of Tomcat 10 used Java 11. From my tomcat.service. See below, once commented out that line. Now, it is running on Java 17.

# Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

The Java release being used by Tomcat is clearly stated at starting time, but I never realized of the error until I debug it. Here it is the “/opt/tomcat/conf/logging.properties” file I modify to get debugging information about the issue:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, 5xwiki.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.AsyncFileHandler.level = ALL
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8

2localhost.org.apache.juli.AsyncFileHandler.level = ALL
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.maxDays = 90
2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8

3manager.org.apache.juli.AsyncFileHandler.level = ALL
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.maxDays = 90
3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

4host-manager.org.apache.juli.AsyncFileHandler.level = ALL
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90
4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

5xwiki.org.apache.juli.AsyncFileHandler.level = ALL
5xwiki.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
5xwiki.org.apache.juli.AsyncFileHandler.prefix = xwiki.
5xwiki.org.apache.juli.AsyncFileHandler.maxDays = 90
5xwiki.org.apache.juli.AsyncFileHandler.encoding = UTF-8

java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/xwiki].level = FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/xwiki].handlers = 5xwiki.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/xwiki].level = FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/xwiki].handlers = 5xwiki.org.apache.juli.AsyncFileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE

# To see debug messages for HTTP/2 handling, uncomment the following line:
#org.apache.coyote.http2.level = FINE

# To see debug messages for WebSocket handling, uncomment the following line:
#org.apache.tomcat.websocket.level = FINE

@tmortagne, thank you very much for your help!

Hi! After breaking the automagic update/upgrade Ubuntu flow by sticking to Ubuntu 22.04 while manually updating to Tomcat 10, I’m still able to keep running my XWiki instance with your help, but I’m no longer feel confident with what I’m doing.

In a previous entry in this thread, I read the following output at the Ubuntu terminal:

rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
ii  xwiki-common                                     17.2.1                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
ii  xwiki-mysql-common                               17.2.1                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis

Right now, I read:

rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
rc  xwiki-common                                     17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-mysql-common                               17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis

In between both status, I did some regular updates/upgrades with the usual line sudo apt update && sudo apt upgrade. I don’t remember any warning or scaring message or hard decision to be taken, but yesterday I found a message saying that /xwiki was not available again. Fortunately, the error log quickly helped me to understand the issue and solve it: /usr/lib/xwiki show how disappeared.

All I needed to do was to recreate the folder from a backup copy, in this case with the simple line sudo cp -a xwiki.bak20250418/. /usr/lib/xwiki/. Now, XWiki is back! :slight_smile:

But I don’t understand in which point I am now concerning XWiki update/upgrade procedure.

Please, could the disappearing folder issue be related with some update/upgrade decisions I toke? Can I keep updating xwiki-common and xwiki-mysql-common packages with apt while maintaining a manual Tomcat 10 installation? Should I forget about apt and use an alternative update process (I guess the WAR method can do the trick)?

Thanks again for your insights!

The only thing I can think of that would remove that folder is uninstalling xwiki-common.

I don’t see why not. Just make sure to stop tomcat before doing the upgrade and start it again when you are done, since the packages won’t take care of that.

I probably thoughtlessly answered some question the system asked me, but I don’t remember agreeing to an uninstall. I will pay more attention!

It seems the current state of the concerned installation is no longer aware initially it was installed using Debian/Ubuntu .DEB packages. Now that XWiki 17.3.0 was released, that system is not aware of the available upgrade. It is not an unexpected situation to me as I manually installed Tomcat 10 and somehow removed, although recovered from a backup, the contents installed by xwiki-common. See below:

rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
rc  xwiki-common                                     17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-mysql-common                               17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-common                             16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-tomcat9-mysql                              16.10.2                                 all          XWiki is a free wiki software platform written in Java with a design emphasis
rjr@e220i057h096l:~$ apt list --upgradable
Listing... Done
distro-info-data/jammy-updates,jammy-updates 0.52ubuntu0.9 all [upgradable from: 0.52ubuntu0.8]
gnome-shell-common/jammy-updates,jammy-updates 42.9-0ubuntu2.3 all [upgradable from: 42.9-0ubuntu2.2]
gnome-shell-extension-prefs/jammy-updates 42.9-0ubuntu2.3 amd64 [upgradable from: 42.9-0ubuntu2.2]
gnome-shell/jammy-updates 42.9-0ubuntu2.3 amd64 [upgradable from: 42.9-0ubuntu2.2]
grub-efi-amd64-bin/jammy-updates 2.06-2ubuntu14.8 amd64 [upgradable from: 2.06-2ubuntu14.4]
grub-efi-amd64-signed/jammy-updates 1.187.12+2.06-2ubuntu14.8 amd64 [upgradable from: 1.187.6+2.06-2ubuntu14.4]
libnautilus-extension1a/jammy-updates 1:42.6-0ubuntu2 amd64 [upgradable from: 1:42.6-0ubuntu1]
nautilus-data/jammy-updates,jammy-updates 1:42.6-0ubuntu2 all [upgradable from: 1:42.6-0ubuntu1]
nautilus/jammy-updates 1:42.6-0ubuntu2 amd64 [upgradable from: 1:42.6-0ubuntu1]
xwayland/jammy-updates 2:22.1.1-1ubuntu0.18 amd64 [upgradable from: 2:22.1.1-1ubuntu0.17]

apt list --upgradable doesn’t list any XWiki related available upgrade.

I think I could securely purge xwiki-tomcat9-common and xwiki-tomcat9-mysql packages/residual configuration, as I’m no longer using Tomcat 9. But I’m not so sure about xwiki-common and xwiki-mysql-common.

Must I purge all rc marked xwiki- packages? Must I install xwiki-common and xwiki-mysql-common again to get my installation upgraded to XWiki 17.3.0?

Thanks!

That looks like another sign that it was uninstalled for some reason.

Yes.

I would suggest installing those packages back (you might need to delete again /usr/lib/xwiki/, to avoid conflicts). It will make much easier to upgrade them.

Done! See the results:

rjr@e220i057h096l:~$ sudo apt-get remove --purge $(dpkg -l | grep xwiki-tomcat9 | awk '/^rc/{print $2}')
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  xwiki-tomcat9-common* xwiki-tomcat9-mysql*
0 upgraded, 0 newly installed, 2 to remove and 9 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 312741 files and directories currently installed.)
Purging configuration files for xwiki-tomcat9-common (16.10.2) ...
Purging configuration files for xwiki-tomcat9-mysql (16.10.2) ...
rjr@e220i057h096l:~$ dpkg-query --list | grep xwiki
rc  xwiki-common                                     17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rc  xwiki-mysql-common                               17.2.2                                  all          XWiki is a free wiki software platform written in Java with a design emphasis
rjr@e220i057h096l:~$ 

Sorry to ask again, but I’m still far from understanding the whole process. To the best of my current understanding, I would need to firstly purge xwiki-common and xwiki-mysql-common as I did above with tomcat9-related packages, then reinstall both of them to get the new XWiki release. That way, I will remove any trace of XWiki 17.2.2, and it will also remove usr/lib/xwiki/. But, will the config files affected by the proposed remove/reinstall operation?

Or I must simply remove usr/lib/xwiki/ and install xwiki-common and xwiki-mysql-common again?

Thanks!

Sounds like the safest to me. I’m afraid that if you purge xwiki-mysql-common, dbconfig might wipe the database (since the database is created by dbconfig).

It sounds scary! Before trying anything else with this XWiki instance, I will try to get a clone of the XWiki contents running on a brand new Ubuntu 24.04 installation. Not the most modern box in the neighbourhood, but it must do the trick.

I don’t remember how many times I tried, and failed, to clone XWiki contents in the last fifteen years! I’m sure I didn’t invest effort enough. Thus, I will try again!

Please, although surely I must open a new thread/topic, could you point me in the right direction to clone all contents of a XWiki 17.2.3 installation running on Ubuntu 22.04.5 LTS/Tomcat10/MySQL Server version: 8.0.41-0ubuntu0.22.04.1 (Ubuntu) to an Ubuntu 24.04 running XWiki as per the current available XWiki, MySQL and Tomcat releases installed as .DEB packages?

Thanks!

I guess it would be https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Backup (even if the system is slightly different, the important thing is that it’s the same database engine so it’s technically a backup/restore).

1 Like