You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading the otel-operator to version 0.112.0, java8 containers that use auto-instrumentation with inject-java attributes fail to start with the following error:
Picked up JAVA_TOOL_OPTIONS: $(JAVA_TOOL_OPTIONS) -javaagent:/otel-auto-instrumentation-java/javaagent.jar
Unrecognized option: $(JAVA_TOOL_OPTIONS)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I believe this is due to #1814 being patched in the 0.112.0 version.
Steps to Reproduce
Attempt to run a java8 application using autoinstrumentation after upgrading to otel-operator 0.112.0. The java container will crash loop with the above error.
Expected Result
Auto-instrumentation to load the javaagent without crashing the java application.
Actual Result
Java8 container crash loops.
Kubernetes Version
1.31.0
Operator version
0.112.0
Collector version
0.112.0
Environment information
Environment
Java Zulu JRE 8.0.432-1
Log output
Picked up JAVA_TOOL_OPTIONS: $(JAVA_TOOL_OPTIONS) -javaagent:/otel-auto-instrumentation-java/javaagent.jar
Unrecognized option: $(JAVA_TOOL_OPTIONS)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Additional context
Reverting to 0.107.0 of the otel-operator resolves the issue.
The text was updated successfully, but these errors were encountered:
ryanohnemus
changed the title
JAVA_TOOL_OPTIONS environment expansion added in 0.112.0 crash loops java8 applications, preventing container start
JAVA_TOOL_OPTIONS environment expansion added in 0.112.0 crash loops java applications while running on gke
Nov 15, 2024
I ran through a few different versions of this setup and found this specifically is due to different handling of ENV vars within GKE vs normal k8s.
(As far as a deployment i was using the image: azul/zulu-openjdk:8-jre-latest with a command of ["java", "-version"] with autoinstrumentation enabled and an env var of JAVA_TOOL_OPTIONS=-Xdebug set. Java isn't the root issue in this case, it's actually the env variable handling differences in k8s version).
The change from #1814 appears to add a 2nd environment variable of the exact same name.
On a kind 1.31 cluster that results in the created pod existing with 2 env vars of the same name:
However when running on GKE's 1.31 version, it seems you are not allowed to have multiple env vars of the same name. These get collapsed when the pod is created and you have a pod that only has the last defined variable:
Hi @pavolloffay@ryanohnemus ! Duplicate env vars don't work for us either (aws eks v1.28.13). Instead of two JAVA_TOOL_OPTIONS, there is only one JAVA_TOOL_OPTIONS in the pod resource with this value
I think there is some kind of mutating webhook in our cluster that is causing such behaviour. I haven't identified which one, but I can investigate this later.
Component(s)
auto-instrumentation
What happened?
Description
After upgrading the otel-operator to version 0.112.0, java8 containers that use auto-instrumentation with
inject-java
attributes fail to start with the following error:I believe this is due to #1814 being patched in the 0.112.0 version.
Steps to Reproduce
Attempt to run a java8 application using autoinstrumentation after upgrading to otel-operator 0.112.0. The java container will crash loop with the above error.
Expected Result
Auto-instrumentation to load the javaagent without crashing the java application.
Actual Result
Java8 container crash loops.
Kubernetes Version
1.31.0
Operator version
0.112.0
Collector version
0.112.0
Environment information
Environment
Java Zulu JRE 8.0.432-1
Log output
Additional context
Reverting to 0.107.0 of the otel-operator resolves the issue.
The text was updated successfully, but these errors were encountered: