-
Notifications
You must be signed in to change notification settings - Fork 295
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
Crash with Error: socket hang up #1253
Comments
We might have just encountered the similar issue after the recent package update. Our error stack is like this: /srv/package/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:18
throw e
^
Error: socket hang up
at connResetException (internal/errors.js:609:14)
at Socket.socketCloseListener (_http_client.js:401:25)
at /srv/package/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:54:19
at Scope._activate (/srv/package/node_modules/dd-trace/packages/dd-trace/src/scope/async_resource.js:47:14)
at Scope.activate (/srv/package/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:12:19)
at Socket.bound (/srv/package/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:53:20)
at Socket.emit (events.js:326:22)
at Socket.EventEmitter.emit (domain.js:483:12)
at TCP.<anonymous> (net.js:675:12)
at TCP.callbackTrampoline (internal/async_hooks.js:126:14) dd-trace version: 0.31.0 |
What was the last version where the error didn't occur? This will help isolating the change that may be causing this. |
For us, our previous version is "0.26.1" |
ours was "0.25.1" |
In our case, "0.30.1" works well, but "0.30.6" does not. |
I've been unable to reproduce so far, so would like to rule out commits if possible. Would it be possible for anyone to try 0.30.2 in some test environment? There was a pretty big commit between 0.30.1 and 0.30.2 so I'd like to either rule it out or confirm that it might actually be the cause. Also, is this something that can be reproduced in a snippet that could be shared here? |
@rochdev we are having the same problem with To do this, we are running node const axios = require('axios')
const MockAdapter = require('axios-mock-adapter')
const mock = new MockAdapter(axios)
mock.onPost('/test').timeout()
const main = async () => {
try {
const { data } = await axios.post('/test')
console.log(data)
} catch (error) {
console.log('error', error)
}
}
main() |
Great find, I can confirm that we are using axios as well. |
@trajanoreuter Thanks for sharing this snippet! How do I use it to reproduce the issue? I get the same |
Just follow up with the issue, we did the dd-trace upgrade due to axios vulnerabilities, so our axios version for the whole service is 0.21.1. So maybe the newer axio is causing issue? |
@superwesker1988 That would make sense, since the error reported in this thread doesn't look like it's coming from the tracer. The tracer is only involved because of the scope manager that would appear on any event stack trace. We weren't able to identify what change we did that could cause issues without changing any of our code, but updating Axios would definitely make sense. I'm still unable to replicate even with 0.21.1 however, but when I'm able to do it we should be able to quickly fix any incompatibility between dd-trace and that version of Axios. |
Had the same result using an Axios call as @trajanoreuter brought up Agent: 6.24.1
|
This is almost identical to the issue we have encountered. |
@rochdev in our case we have the problem related to the socket hang up while our application is running and collecting metrics. require('dd-trace').init({ runtimeMetrics: true }) And we are using We also tried with different agents, |
Actually it looks like axios was updated in dd-trace 0.29.2, but there are several reports in this thread that a few versions after that didn't have the issue, so I'm not sure it's directly related, or at least it wouldn't be the only cause. |
@rochdev Is there anything that can be done to avoid this problem until we don't know how to fix and what is the cause? |
A few things potentially, none of which are ideal but could temporarily mitigate the issue:
I'm still trying to replicate this, to no avail so far. If anyone has a snippet that I could run to replicate this then it should be a quick fix. Unfortunately, for this type of issue, replicating it is usually the most difficult part. |
One detail in our case I would like to add was that the issue constantly happened in a dev env where our Data Dog APM was disabled (yeah, our service was mis configured in that env). Not sure if this would help. |
@superwesker1988 Can you provide more details about how it was disabled? Was it through configuration, some condition, disabled in the agent, etc? There are reports above of the issue not happening when dd-trace is disabled so I'm trying to get a sense of what seems to trigger it. |
Hi @rochdev , I talked to our infra teams, it seems like it was done via configuration:
|
I was just able to reproduce the issue, looking into the root cause now. |
Turns out the issue was a bug in the tracer that was triggered by follow-redirects/follow-redirects@ad15f9b. Working on a fix now and will release a new version as soon as possible. Thanks all for your help and patience on this issue. |
First of all, thanks for all the effort put into this fix @rochdev . Do we have a ETA for this PR to be applied? |
@lucianopf I'm working on the release right now, so should be within the next hour. |
Fix released in 0.31.1 |
Hey, im still getting timeout while using https://github.com/DataDog/datadog-lambda-js/tree/v4.66.0
|
@vladimirnani This is a different error so I would say to open a new issue. |
Describe the bug
One of our services has started crashing, and the last thing printed out is the following:
If I disable tracing in the init via enabled:false, then it stops crashing, we didn't see this on older versions of dd-trace.
The exit status we get is
1
Environment
Ubuntu 20.04
v10.19.0
v0.30.6
Agent (v7.24.1)
The text was updated successfully, but these errors were encountered: