I've created an eXist-DB based application. This application should be deployed inside a Docker container. My application relies on some heavy pre-computation, which should store the result in the db-index (lucene).
For example parts of my collection.xconflook like:
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<fulltext default="none" attributes="false"/>
<lucene>
<module uri="http://example.org/index" prefix="index" at="index_.xql"/>
<text qname="tei:TEI">
<!-- more fields here -->
<field name="title" expression="index:get-title(.)"/>
</text>
<!-- more here-->
</lucene>
</index>
</collection>
For the calculation I am importing an external module (index_.xql), which is placed in the root of my application. This module holds more or less complex logic, which used here for the calculation.
When I am building and starting the container with a Mac OS (Apple Silicon) host everything works fine (using the default docker context). When I am switching to a Linux host (e.g. a VPS) things don't work as expected any longer. The logs show the following error-message:
[main] ERROR (AbstractFieldConfig.java [compile]:145) - Failed to compile expression: declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace xs="http://www.w3.org/2001/XMLSchema";
import module namespace index="http://example.org/index" at "xmldb:exist:///db/apps/myapp/index_.xql";
index:get-title(.): err:XQST0059 error found while loading module index: Module location hint URI 'xmldb:exist:///db/apps/myapp/index_.xql' does not refer to anything.
I've thought maybe it could be a problem with file privileges, but everything seems to be right. I've also tried running with PUID=1000 and PGID=1000. But does not disappear.
For more context here is my Dockerfile
FROM docker.io/stadlerpeter/existdb:6
USER wegajetty
ARG BUILD_DIR
COPY --chown=wegajetty ${BUILD_DIR}/*.xar ${EXIST_HOME}/autodeploy/
I can reproduce the problem on my mac, if am switching to a different container runtime context like containerd. For me there seems to be no obvious reason for this problem.
So maybe anyone knows a way how to fix this problem. Thanks in advance!