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

DD_AGENT_HOST set as the host IP fails in an IPv6-only EKS environment #7713

Open
jungnoh opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@jungnoh
Copy link

jungnoh commented Oct 2, 2024

I am trying to instrument a Java application orchestrated in an EKS cluster.
I've set DD_AGENT_HOST as guided in Kubernetes APM - Trace Collection docs with the following YAML.

        env:
          - name: DD_AGENT_HOST
            valueFrom:
              fieldRef:
                fieldPath: status.hostIP

This was not a problem and worked well in a IPv4 EKS environment. However, the Agent fails when an IPv6 address is given:

[dd.trace 2024-10-02 22:29:13:511 +0900] [main] ERROR datadog.trace.bootstrap.Agent - Throwable thrown while installing the Datadog Tracer                                                                          java.lang.reflect.InvocationTargetException                                                                                                                                                                             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)                                                                                                                 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                         at java.base/java.lang.reflect.Method.invoke(Method.java:569)                                                                                                                                                       at datadog.trace.bootstrap.Agent.installDatadogTracer(Agent.java:642)                                                                                                                                               at datadog.trace.bootstrap.Agent.access$400(Agent.java:68)                                                                                                                                                          at datadog.trace.bootstrap.Agent$InstallDatadogTracerCallback.execute(Agent.java:525)                                                                                                                               at datadog.trace.bootstrap.Agent.start(Agent.java:351)                                                                                                                                                              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)                                                                                                                 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                         at java.base/java.lang.reflect.Method.invoke(Method.java:569)                                                                                                                                                       at datadog.trace.bootstrap.AgentBootstrap.agentmainImpl(AgentBootstrap.java:155)                                                                                                                                    at datadog.trace.bootstrap.AgentBootstrap.agentmain(AgentBootstrap.java:72)                                                                                                                                         at datadog.trace.bootstrap.AgentBootstrap.premain(AgentBootstrap.java:60)                                                                                                                                           at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)                                                                                                                 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                         at java.base/java.lang.reflect.Method.invoke(Method.java:569)                                                                                                                                                       at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)                                                                                                          at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)                                                                                                     Caused by: java.lang.IllegalArgumentException: Bad agent URL: http://2406:da1a:2c6:5304::b65a:8126                                                                                                                      at datadog.communication.ddagent.SharedCommunicationObjects.createRemaining(SharedCommunicationObjects.java:35)                                                                                                     at datadog.trace.agent.core.CoreTracer.<init>(CoreTracer.java:648)                                                                                                                                                  at datadog.trace.agent.core.CoreTracer.<init>(CoreTracer.java:122)                                                                                                                                                  at datadog.trace.agent.core.CoreTracer$CoreTracerBuilder.build(CoreTracer.java:483)                                                                                                                                 at datadog.trace.agent.tooling.TracerInstaller.installGlobalTracer(TracerInstaller.java:26)                                                                                                                         ... 21 more                                                                                                                                                                                                     [dd.trace 2024-10-02 22:29:13:528 +0900] [main] CRITICAL com.datadog.appsec.AppSecSystem - AppSec could not start because of an unexpected error. No security activities will be collected. Please contact support ajava.lang.IllegalArgumentException: Bad agent URL: http://2406:da1a:2c6:5304::b65a:8126                                                                                                                                 at datadog.communication.ddagent.SharedCommunicationObjects.createRemaining(SharedCommunicationObjects.java:35)                                                                                                     at datadog.communication.ddagent.SharedCommunicationObjects.createPoller(SharedCommunicationObjects.java:89)                                                                                                        at datadog.communication.ddagent.SharedCommunicationObjects.configurationPoller(SharedCommunicationObjects.java:76)
    at com.datadog.appsec.AppSecSystem.doStart(AppSecSystem.java:73)
    at com.datadog.appsec.AppSecSystem.start(AppSecSystem.java:48)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

For okhttp to parse the URL correctly, it seems like the URL should have been built as http://[2406:da1a:2c6:5304::b65a]:8126.
I am using dd-trace-java 1.70.0.

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