Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant deploy if hazelcast.loggingLevel set #210

Open
andrey-gava opened this issue Mar 23, 2021 · 6 comments
Open

Cant deploy if hazelcast.loggingLevel set #210

andrey-gava opened this issue Mar 23, 2021 · 6 comments

Comments

@andrey-gava
Copy link
Contributor

hazelcast.loggingLevel=DEBUG

Error within pod:
sed: can't create temp file 'logging.propertiesXXXXXX': Read-only file system

Its related to securityContext.readOnlyRootFilesystem that set by default to true.

@leszko
Copy link

leszko commented Mar 24, 2021

Which Helm Chart / Docker image do you use? I guess it should not be an issue with the latest one.

@andrey-gava
Copy link
Contributor Author

Which Helm Chart / Docker image do you use? I guess it should not be an issue with the latest one.

Chart 3.6.2
Docker image 4.0.2

@leszko
Copy link

leszko commented Apr 14, 2021

I checked the latest version and it worked for me.

helm install hz --set hazelcast.loggingLevel=DEBUG hazelcast/hazelcast

If it doesn't work, then it may be related to your k8 environment. You can also try setting the security context like this.

helm install hz --set hazelcast.loggingLevel=DEBUG --set securityContext.readOnlyRootFilesystem.false hazelcast/hazelcast

@shahamit
Copy link

@leszko - none of the above commands worked. The hazelcast instance fails to start with a ClassNotFoundException

Ideally it should have worked with the loggingLevel property because the values.yaml file also states so but strange that it doesn't worked. Any solutions?

The complete k8s logs are as below

########################################
# JAVA=/usr/bin/java
# JAVA_OPTS=--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED -Dhazelcast.logging.type=log4j2 -Dlog4j.configurationFile=file:/opt/hazelcast/config/log4j2.properties -Dhazelcast.config=/opt/hazelcast/config/hazelcast-docker.xml -Djet.custom.lib.dir=/opt/hazelcast/custom-lib -Djava.net.preferIPv4Stack=true -XX:MaxRAMPercentage=80.0 -XX:MaxGCPauseMillis=5 -Dhazelcast.config=/data/hazelcast/hazelcast.yaml -DserviceName=hazelcast -Dnamespace=default -Dhz.jet.enabled=true -Dhazelcast.shutdownhook.policy=GRACEFUL -Dhazelcast.shutdownhook.enabled=true -Dhazelcast.graceful.shutdown.max.wait=600 map[loggingLevel:DEBUG]
# CLASSPATH=/opt/hazelcast/*:/opt/hazelcast/lib:/opt/hazelcast/lib/*:/opt/hazelcast/bin/user-lib:/opt/hazelcast/bin/user-lib/*
########################################
Error: Could not find or load main class map[loggingLevel:DEBUG]
Caused by: java.lang.ClassNotFoundException: map[loggingLevel:DEBUG]

@shahamit
Copy link

Finally defining an environment variable named LOGGING_LEVEL in the values file worked.

@hasancelik
Copy link
Collaborator

Hi @shahamit,

Finally defining an environment variable named LOGGING_LEVEL in the values file worked.

In a functional level, hazelcast.loggingLevel does the same thing actually:

https://github.com/hazelcast/charts/blob/master/stable/hazelcast/templates/statefulset.yaml#L160

I have also tested with the latest version, and it worked:

helm install hz --set hazelcast.loggingLevel=DEBUG hazelcast/hazelcast

Could you share your chart version and values.yaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants