TRACE log level causes an application to fail
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- observability-sre
Research direction
Start with the stack trace and read AppInsightsCertificate.java, especially executeWithoutException, loadCertificates, and isInJavaKeystore, then inspect FirstEntryPoint.init. Reproduce the agent startup with TRACE when keytool is unavailable and determine why this causes the application to fail. Done means the application starts successfully and the missing-keytool condition is logged without aborting startup.
Written by the indexing model from the issue text.
Description
Expected behavior
Don't fail a main application. Probably use WARN log level.
Actual behavior
The enabled JVM agent with TRACE log level causes a Java application to fail.
To Reproduce
- Connect a JVM agent (
-javagent:/path/to/application-insights-3.4.17.jar). - Provide a connection string.
- Set an environment variable
APPLICATIONINSIGHTS_SELF_DIAGNOSTICS_LEVELtoTRACE. - Run a Java application.
System information
Please provide the following information:
- SDK Version: 3.4.17
- OS type and version: RHEL 8.9
- Application Server type and version (if applicable): Apache Spark 3.4.
- Using spring-boot? No.
- Additional relevant libraries (with version, if applicable): N/A.
Logs
...
2024-01-26 17:09:03.3392 ERROR c.m.applicationinsights.agent - Error related to the execution of [keytool, -list, -rfc, -keystore, /opt/java/jdk-17.0.9+9-jre/lib/security/cacerts]
java.io.IOException: Cannot run program "keytool": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at com.microsoft.applicationinsights.agent.internal.init.AppInsightsCertificate.executeWithoutException(AppInsightsCertificate.java:96)
at com.microsoft.applicationinsights.agent.internal.init.AppInsightsCertificate.loadCertificates(AppInsightsCertificate.java:83)
at com.microsoft.applicationinsights.agent.internal.init.AppInsightsCertificate.isInJavaKeystore(AppInsightsCertificate.java:74)
at com.microsoft.applicationinsights.agent.internal.init.FirstEntryPoint.init(FirstEntryPoint.java:131)
at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:95)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(Agent Initializer.java:53)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:47)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.execute(AgentInitializer.java:64)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:46)
at io.opentelemetry.javaagent.OpenTelemetryAgent.startAgent(OpenTelemetryAgent.java:57)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:45)
at com.microsoft.application insights.agent.Agent.premain(Agent.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
at java.instrument/sun. instrument. InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(Unknown Source)
at java.base/java.lang. ProcessImpl.start(Unknown Source)
... 20 common frames omitted
2024-01-26 17:09:03.340Z TRACE c.m.application insights.agent - Application Insights root certificate in the Java keystore: false
...
- Dominant language
- Java
- Stars
- 327
- Forks
- 222
- Avg merge
- 22h 34m
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/ApplicationInsights-Java#4817 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/ApplicationInsights-Java#4770 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/ApplicationInsights-Java#4769 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/ApplicationInsights-Java#4729 · 121 comments ·
All issues in microsoft/ApplicationInsights-Java
Similar issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/flink-agents#1152 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo-graphs#75 ·