kartoza/docker-geoserver

/scripts/functions.sh: line 261: /opt/geoserver/data_dir/cluster/instance_ip-xx-xx-xx-xx.us-east1.compute.internal/broker.xml: No such file or directory

ze-ahmed opened this issue · 3 comments

What is the bug or the crash?

Hello,

I'm getting the following error:

/scripts/functions.sh: line 261: /opt/geoserver/data_dir/cluster/instance_ip-xx-xx-xx-xx.us-east1.compute.internal/broker.xml: No such file or directory

when starting my container (Please note that I'm using AWS ECS and data_dir is in EFS Volume), the container starts but is not loading corectly all the env variables. For example: EMBEDDED_BROKER is set to disabled but it is started, also HOST variable is not loaded with the desired and passed value

Please note that after testing on docker locally I found that some folders and files under data_dir are owned by root and this is perhaps the origin of the issue

Thanks for helping

Steps to reproduce the issue

Deploy geoserver on ECS and use EFS for data_dir by updating the env variable GEOSERVER_DATA_DIR

Versions

kartoza/geoserver:2.23.1

Additional context

No response

After investigation, the issue is related to EXISTING_DATA_DIR env variable. In start.sh we have the following line
# setup clustering if it's not already defined in an existing data directory if [[ -z "${EXISTING_DATA_DIR}" ]]; then cluster_config broker_config fi

As it is a boolean, we can use true or false but in the test if we use false, the cluster setup is not performed.

I think a much more better test is to check if cluster.properties is contained in the data dir. if it's not defined then we skip setting it up.

We would also have to extract the cluster folder name as it's used in the Java opt.

Or alternatively skip checking if cluster config already exists and always force to create directory

@ze-ahmed what are your thoughts

You just need to test for cluster.properties after cluster configuration