Open paulbuer08 opened 2 months ago
This part of the log looks like a java security issue:
...
Unable to make field private java.lang.String java.util.TimeZone.ID accessible: module java.base does not "opens java.util" to unnamed module
...
Adding these JAVA_OPTS should fix it: --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
Thanks @kaicode for the quick response.
But still I'm getting the same errors, I have added your suggested options:
docker run --name snowstorm --network fhir-network -p 8080:8080 -e "ELASTICSEARCH_HOST=http://localhost:9200" -e "JAVA_OPTS=-Xms2g -Xmx4g --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED" snomedinternational/snowstorm:latest
I have also tried extending the options further to cover more internal packages, but still the same result:
docker run --name snowstorm --network fhir-network \
-p 8080:8080 \
-e "ELASTICSEARCH_HOST=http://localhost:9200" \
-e "JAVA_OPTS=-Xms2g -Xmx4g -Dspring.profiles.active=debug \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.time=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.security=ALL-UNNAMED \
--add-opens=java.base/java.text=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.util.stream=ALL-UNNAMED \
--add-opens=java.base/java.nio.charset=ALL-UNNAMED \
--add-opens=java.base/java.util.TimeZone=ALL-UNNAMED \
--add-exports=java.base/sun.nio.cs=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-exports=java.base/sun.security.util=ALL-UNNAMED \
--add-exports=java.base/sun.security.x509=ALL-UNNAMED" \
snomedinternational/snowstorm:latest
After some testing with your approach this seems to work:
docker run --name snowstorm --network fhir-network -p 8080:8080 -e \
-e JAVA_TOOL_OPTIONS="-Xms2g -Xmx4g --add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED" snomedinternational/snowstorm:latest \
--elasticsearch.urls=http://elasticsearch:9200
Using JAVA_TOOL_OPTIONS
rather than JAVA_OPTS
.
I removed ELASTICSEARCH_HOST
and added --elasticsearch.urls
at the end.
After some testing with your approach this seems to work:
docker run --name snowstorm --network fhir-network -p 8080:8080 -e \ -e JAVA_TOOL_OPTIONS="-Xms2g -Xmx4g --add-opens=java.base/java.lang=ALL-UNNAMED \ --add-opens=java.base/java.util=ALL-UNNAMED" snomedinternational/snowstorm:latest \ --elasticsearch.urls=http://elasticsearch:9200
Using
JAVA_TOOL_OPTIONS
rather thanJAVA_OPTS
. I removedELASTICSEARCH_HOST
and added--elasticsearch.urls
at the end.
Thanks @kaicode, this is working as well in my end. Nice catch!
I am trying to setup and run Hapi FHIR and SnowStorm with ElasticSearch using these images (in wsl2):
ElasticSearch ran okay with:
docker run --name elasticsearch --network fhir-network -p 9200:9200 -e "discovery.type=single-node" -e "xpack.security.enabled=false" -e "ES_JAVA_OPTS=-Xms4g -Xmx4g" elasticsearch:8.11.1
I ran SnowStorm with:
docker run --name snowstorm --network fhir-network -p 8080:8080 -e "ELASTICSEARCH_HOST=http://localhost:9200" -e "JAVA_OPTS=-Xms2g -Xmx4g" snomedinternational/snowstorm:latest
But SnowStorm is failing with these errors: