Docker installation using external MariaDB server

Hello,

I have decided to use Docker to install XWiki on a new VPS running Rocky Linux 8 (Centos 8 replacement). I wish to use an external MariaDB server running on the same network as the VPS and not deploy a Mariadb/mysql container for performance reasons…

I followed the instructions of “xwiki-docker/README.md at master · xwiki/xwiki-docker · GitHub” and used Portainer to deploy the “stack” with the exception of not including the “db” block which installs the MariaDB/MySQL container… (see docker-compose.yml below).

The xwiki and solr containers were installed successfully, but when I try to access the XWiki web page it loads for a few seconds , then I get the following errors (truncated with only the Java error messages):

HTTP Status 500 – Internal Server Error

Type Exception Report

Message com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [http://vps.localdomain:8080/bin/view/Main/]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
javax.servlet.ServletException: com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [http://vps.localdomain:8080/bin/view/Main/]

Root Cause
com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [http://vps.localdomain:8080/bin/view/Main/]

Root Cause
java.lang.RuntimeException: Failed to locate wiki descriptor for alias [vps.localdomain]
	
Root Cause
org.xwiki.wiki.manager.WikiManagerException: Failed to locate XWiki.XWikiServerClass document for wiki alias [vps.localdomain]
	
Root Cause
org.xwiki.query.QueryException: Exception while translating [where doc.object(XWiki.XWikiServerClass).server = :wikiAlias and doc.name like 'XWikiServer%'] XWQL query to the [hql] language. Query statement = [where doc.object(XWiki.XWikiServerClass).server = :wikiAlias and doc.name like 'XWikiServer%']
	
Root Cause
com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.XWikiServerClass]
	
Root Cause
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

Root Cause
org.hibernate.HibernateException: Could not create a DBCP pool. There is an error in the Hibernate configuration file, please review it.

Root Cause
java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value if you want to utilize time zone support.)
	
Root Cause
java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value if you want to utilize time zone support.

Root Cause
com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value if you want to utilize time zone support.

Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/8.5.72

It seems that there is a mis-configuration regarding timezone for mariadb. According to the Xwiki MySQL Installation page:

  • The MySQL conf file on the server
  • In the XWiki hibernate.cfg.xml file in the hibernate.connection.serverTimezone property (e.g. Europe/Berlin).
  • In the XWiki hibernate.cfg.xml file inside the JDBC URL string as in jdbc:mysql://localhost:3306/myschema?serverTimezone=UTC

The MariaDB server is already configured with America/Toronto (and only xwiki complains about this so I know this is not an issue on the DB server).

I tried passing several ENV variables to the xwiki container (such as “TZ=America/Toronto”, “server.Timezone=America/Toronto”, etc…) and re-deploying the container, nothing worked.

The docker-compose.yml I used in Portainer stack deployment is:

version: '2'
networks:
  bridge:
    driver: bridge
services:
  web:
    image: "xwiki:lts-mysql-tomcat"
    container_name: xwiki-web
    depends_on:
      - index
    ports:
      - "8080:8080"
    environment:
      - XWIKI_VERSION=xwiki
      - DB_USER=xwikidb
      - DB_PASSWORD=XXXXXXXXXXXXXx
      - DB_DATABASE=xwikidb
      - DB_HOST=database.localdomain
      - INDEX_HOST=xwiki-index
    volumes:
      - /mnt/data/xwiki/data:/usr/local/xwiki
    networks:
      - bridge
  index:
    image: "solr:7.2"
    container_name: xwiki-index
    volumes:
      - /mnt/data/xwiki/solr:/docker-entrypoint-initdb.d
      - /mnt/data/xwiki/solr/data:/opt/solr/server/solr
    networks:
      - bridge
volumes:
  xwiki-data: {}
  solr-data: {}

The database parameters above are those needed to connect to the external DB server. The xwiki container can resolve the DB server (I can see connection attempts in the Mariadb logs).

Not sure what to do from here as I am pretty new to the whole Docker thing, and Xwiki as well. I installed Xwiki “baremetal” before on a Centos 7 VPS, and it never worked well (I messed up the install) so I thought using Docker this time to avoid doing anything wrong…

Any idea?

@mods: Please mark this thread ad SOLVED (or delete) since it is no longer relevant as I have decided to install “bare metal” and no longer use Docker.