dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

DDAgentApi keep throwing SocketException: Connection reset?

Open kevinlilendi opened this issue 5 years ago • 9 comments

Hi,

I keep getting this error.

[dd.trace 2021-04-15 04:27:00:159 +0000] [dd-trace-writer] WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 1 of 1 (size=1015B) traces to the DD agent. Total: 2043, Received: 2043, Sent: 0, Failed: 2043. java.net.SocketException: Connection reset (Will not log errors for 5 minutes)

But the metrics and logs still work in Datadog.

Is there any way to fix this Error?

Thanks

kevinlilendi avatar Apr 15 '21 04:04 kevinlilendi

@kevinlilendi,

It looks like datadog-agent was running and then it was properly shut down(restarted?) and closed the connection. But jvm application (with -javaagent:dd-java-agent.jar) keeps sending remaining traces to already closed connection.

Could you please provide more logs before that and more information about your environment? What are the versions of datadog-agent and java tracer are you using ?

lpriima avatar Apr 15 '21 05:04 lpriima

I am getting a similar error

WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 1 (size=591B) traces to the DD agent. Total: 130, Received: 130, Sent: 0, Failed: 130. java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8126

my dd agent is running and I am still getting this error? can you help?

yogiv88 avatar Aug 13 '21 20:08 yogiv88

Any updates or workarounds for this issue? Seeing the same error with DD agent up and running.

ryan81g avatar Oct 13 '21 14:10 ryan81g

Hey, we are also experiencing this warning, (even though the agent seems to work):

[dd.trace 2022-02-10 21:58:40:961 +0000] [dd-trace-processor] WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 27 (size=21KB) traces to the DD agent. Total: 6288, Received: 6288, Sent: 0, Failed: 6288. java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8126 (Will not log errors for 5 minutes)

Should we ignore that warning or is there a fix?

mrluka avatar Feb 10 '22 22:02 mrluka

any updates/ fixes here? getting spammed by dd-trace-writer] WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 1 of 1 traces to the DD agent. java.net.SocketException: Connection reset (going silent for 5 minutes) ^^ log entry from today, spam started on March 5th

DD_APM_NON_LOCAL_TRAFFIC is set to true

btara1 avatar Mar 08 '22 13:03 btara1

Any ideas why it's happening [dd-trace-processor] WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 32 (size=126KB) traces to the DD agent. Total: 66536, Received: 66536, Sent: 0, Failed: 66536. java.net.SocketTimeoutException: Connect timed out (Will not log errors for 5 minutes) ?

SVynnytska avatar Mar 13 '23 15:03 SVynnytska

@SVynnytska - I have faced similar issue, turned out it was "network policy" who was blocking http:localhost:8126 communication. upon opening up network policy APM trace started reporting trace in DD UI.

kdave1 avatar Sep 01 '23 21:09 kdave1