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

[: Illegal number: 09:52:08:460 when using JAVA_TOOL_OPTIONS with a java agent #68

Open
froque opened this issue Jun 11, 2024 · 0 comments

Comments

@froque
Copy link

froque commented Jun 11, 2024

We are using Datadog java agent in JAVA_TOOL_OPTIONS environment variable:
export JAVA_TOOL_OPTIONS="-javaagent:dd-java-agent.jar -Ddd.writer.type=LoggingWriter"

This means that when stork tries to discover java versions, the java version parsing algorithm sometimes fails due to the extra output from datadog java agent:

❯ export JAVA_TOOL_OPTIONS="-javaagent:dd-java-agent.jar -Ddd.writer.type=LoggingWriter" 
❯ java -version 2>&1 | grep "version" | awk '{print $3}' | tr -d \" 
10:16:24:649
10:16:24:650
10:16:24:650
22.0.1

If the output from datadog java agent is the last and not the java version, the bash script fails with:

❯ ./stork-demo-hellod        
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
Unable to find Java runtime on system with version >= 1.6
Try running 'sudo apt-get install openjdk-6-jre-headless' or
Visit http://java.com to download and install one for your system
@froque froque closed this as completed Jun 11, 2024
@froque froque reopened this Jun 11, 2024
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

1 participant