Problem Description:
According to the official Nextcloud AIO documentation (Containers.md#elasticsearch), it should be possible to adjust the JVM heap size of the Elasticsearch child container by setting the ELASTICSEARCH_HEAP_SIZE environment variable on the nextcloud-aio-mastercontainer. However, testing reveals that regardless of how this variable is set (e.g., to 4g), the ES_JAVA_OPTS environment variable in a newly created nextcloud-aio-fulltextsearch container is consistently fixed at -Xms512M -Xmx512M. This causes Elasticsearch to crash frequently due to insufficient memory (java.lang.OutOfMemoryError: Java heap space), rendering the full-text search feature unusable.
Expected Behavior:
When the nextcloud-aio-mastercontainer is started with, for example, --env ELASTICSEARCH_HEAP_SIZE=4g, the nextcloud-aio-fulltextsearch container it creates should receive the corresponding heap memory configuration (e.g., ES_JAVA_OPTS should reflect -Xms4g -Xmx4g or an equivalent configuration).
Actual Behavior:
- The
nextcloud-aio-mastercontainer's environment variables are confirmed to include ELASTICSEARCH_HEAP_SIZE=4g (verified via Config.Env from docker inspect nextcloud-aio-mastercontainer).
- Even after deleting the old
nextcloud-aio-fulltextsearch container, a new nextcloud-aio-fulltextsearch container recreated by the aforementioned mastercontainer still has ES_JAVA_OPTS set to -Xms512M -Xmx512M in its Config.Env (verified via docker inspect nextcloud-aio-fulltextsearch).
- Logs from the
nextcloud-aio-fulltextsearch container confirm its JVM heap size is 512MB, and it exits due to java.lang.OutOfMemoryError: Java heap space.
- The Nextcloud AIO admin interface does not offer an option to adjust the Elasticsearch JVM heap size.
Steps to Reproduce:
- Stop and remove any existing
nextcloud-aio-mastercontainer and nextcloud-aio-fulltextsearch containers.
sudo docker stop nextcloud-aio-mastercontainer
sudo docker rm nextcloud-aio-mastercontainer
sudo docker rm nextcloud-aio-fulltextsearch
- Start the
nextcloud-aio-mastercontainer with the following command (using ELASTICSEARCH_HEAP_SIZE=4g as an example, and /home/ncdata as the data directory):
sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--env NEXTCLOUD_DATADIR="/home/ncdata" \
--env ELASTICSEARCH_HEAP_SIZE=4g \
ghcr.io/nextcloud-releases/all-in-one:latest
- Wait for the
nextcloud-aio-mastercontainer to start and create the nextcloud-aio-fulltextsearch container.
- Inspect the environment variables of the
nextcloud-aio-mastercontainer:
sudo docker inspect nextcloud-aio-mastercontainer
(Verify that ELASTICSEARCH_HEAP_SIZE=4g is present in Config.Env)
- Inspect the environment variables of the newly created
nextcloud-aio-fulltextsearch container:
sudo docker inspect nextcloud-aio-fulltextsearch
(Observe that ES_JAVA_OPTS in Config.Env is still -Xms512M -Xmx512M)
- Check the logs of the
nextcloud-aio-fulltextsearch container:
sudo docker logs nextcloud-aio-fulltextsearch
(Observe the reported heap size on startup and any OOM errors)
Environment Details:
Impact:
Due to the inability to correctly configure Elasticsearch's memory, the full-text search feature cannot operate stably. The Elasticsearch container continuously crashes due to OutOfMemoryError, impacting system stability and generating numerous error logs. This effectively makes the documented feature for adjusting Elasticsearch memory unusable.
Relevant Log Snippets:
nextcloud-aio-fulltextsearch OOM error log snippet:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to data/java_pidXX.hprof ...
Terminating due to java.lang.OutOfMemoryError: Java heap space
ERROR: Elasticsearch exited unexpectedly, with exit code 3
nextcloud-aio-fulltextsearch JVM arguments on startup (from docker logs ...):
{"@timestamp":"...","message":"JVM arguments [..., -Xms512M, -Xmx512M, ...]"}
{"@timestamp":"...","message":"heap size [512mb]..."}
- Key part of
Config.Env from docker inspect nextcloud-aio-fulltextsearch:
"Env": [
// ...
"ES_JAVA_OPTS=-Xms512M -Xmx512M",
// ...
]
Problem Description:
According to the official Nextcloud AIO documentation (Containers.md#elasticsearch), it should be possible to adjust the JVM heap size of the Elasticsearch child container by setting the
ELASTICSEARCH_HEAP_SIZEenvironment variable on thenextcloud-aio-mastercontainer. However, testing reveals that regardless of how this variable is set (e.g., to4g), theES_JAVA_OPTSenvironment variable in a newly creatednextcloud-aio-fulltextsearchcontainer is consistently fixed at-Xms512M -Xmx512M. This causes Elasticsearch to crash frequently due to insufficient memory (java.lang.OutOfMemoryError: Java heap space), rendering the full-text search feature unusable.Expected Behavior:
When the
nextcloud-aio-mastercontaineris started with, for example,--env ELASTICSEARCH_HEAP_SIZE=4g, thenextcloud-aio-fulltextsearchcontainer it creates should receive the corresponding heap memory configuration (e.g.,ES_JAVA_OPTSshould reflect-Xms4g -Xmx4gor an equivalent configuration).Actual Behavior:
nextcloud-aio-mastercontainer's environment variables are confirmed to includeELASTICSEARCH_HEAP_SIZE=4g(verified viaConfig.Envfromdocker inspect nextcloud-aio-mastercontainer).nextcloud-aio-fulltextsearchcontainer, a newnextcloud-aio-fulltextsearchcontainer recreated by the aforementioned mastercontainer still hasES_JAVA_OPTSset to-Xms512M -Xmx512Min itsConfig.Env(verified viadocker inspect nextcloud-aio-fulltextsearch).nextcloud-aio-fulltextsearchcontainer confirm its JVM heap size is 512MB, and it exits due tojava.lang.OutOfMemoryError: Java heap space.Steps to Reproduce:
nextcloud-aio-mastercontainerandnextcloud-aio-fulltextsearchcontainers.nextcloud-aio-mastercontainerwith the following command (usingELASTICSEARCH_HEAP_SIZE=4gas an example, and/home/ncdataas the data directory):sudo docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 80:80 \ --publish 8080:8080 \ --publish 8443:8443 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --env NEXTCLOUD_DATADIR="/home/ncdata" \ --env ELASTICSEARCH_HEAP_SIZE=4g \ ghcr.io/nextcloud-releases/all-in-one:latestnextcloud-aio-mastercontainerto start and create thenextcloud-aio-fulltextsearchcontainer.nextcloud-aio-mastercontainer:ELASTICSEARCH_HEAP_SIZE=4gis present inConfig.Env)nextcloud-aio-fulltextsearchcontainer:ES_JAVA_OPTSinConfig.Envis still-Xms512M -Xmx512M)nextcloud-aio-fulltextsearchcontainer:heap sizeon startup and any OOM errors)Environment Details:
ghcr.io/nextcloud-releases/all-in-one:latest(as of 2025-06-03)Docker version 28.2.2, build e6534b4Ubuntu 24.04 LTSImpact:
Due to the inability to correctly configure Elasticsearch's memory, the full-text search feature cannot operate stably. The Elasticsearch container continuously crashes due to OutOfMemoryError, impacting system stability and generating numerous error logs. This effectively makes the documented feature for adjusting Elasticsearch memory unusable.
Relevant Log Snippets:
nextcloud-aio-fulltextsearchOOM error log snippet:nextcloud-aio-fulltextsearchJVM arguments on startup (fromdocker logs ...):{"@timestamp":"...","message":"JVM arguments [..., -Xms512M, -Xmx512M, ...]"} {"@timestamp":"...","message":"heap size [512mb]..."}Config.Envfromdocker inspect nextcloud-aio-fulltextsearch: