-
Notifications
You must be signed in to change notification settings - Fork 156
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
Having Error: connect ECONNREFUSED #217
Comments
Hi @kwongkz, |
Hi @willarmiros, I guess I found out the issue & solution already. I did reference this issue to get the idea #143 So the solution for me add env - Hope we can put this in the documentation so other people can get more clear to use it. Thanks for the assist. |
I'm having the same issue. Searching the internet for that IP address leads me to believe it's the IP address of the X-Ray daemon (see here). It definitely should be a "local" IP address because it starts with 169. So I think it should be somewhere in the AWS network, though I'm no network specialist. I've tried adding the |
Hi petermorlion, Is this affecting you on Lambda as well? The Daemon should be automatically configured in Lambda, no need to include it or set it up. |
Hi awssandra, Yes, this is on AWS Lambda. I have it with several Lambda's, all of which use the AWS X-Ray Express package. Strangely, I don't seem to be having the issue when only using the core, but also not when using AWS X-Ray Express with NestJS (both in Lambda's). Though those Lamba's are executed less often. |
Sorry for the delayed response! I'm thinking there's a disconnect between the custom Lambda code and the Express middleware. Each have their own expected workflow of the daemon and SDK behavior. We'll take a deep dive into this. |
Hi @petermorlion, |
@willarmiros I don't mean to put pressure on you, but I'm curious if there is any progress on this? |
Hi @petermorlion, After some further inspection, it appears the root cause is in our service connector here. It's from a poller that runs in the background to retrieve sampling rules from X-Ray's service back end roughly every 5 minutes (speaking of patterns you should see the error about every 5 minutes if you're consistently making requests uninterrupted by cold starts). These requests are attempting to communicate directly with the daemon, which is not possible in Lambda environments. I changed the way we make these requests in #255 to no longer be lazy, and that actually appears to have made the errors appear instantly upon invocation. I'm going to make a PR to disable these requests for now in Lambda environments, since we don't support sampling configuration in Lambda yet. |
@willarmiros Why isn't this possible? Is the X-Ray service on a private network? Also, when you disable them, how will you be checking for it? This code is essentially express code and express code is not aware that it is being run in a lambda environment. In the meantime, will I be able to stop the api call with, AWSXRay.middleware.disableCentralizedSampling(); ? |
Hi @avin-kavish, I will check for Lambda environments using the |
This fix was released in v3.0.0-alpha.2. |
Anyone got idea why this happen? I'm using serverless lambda and with X-Ray tracing turned on
WARN Error: connect ECONNREFUSED 169.254.79.2:2000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
The text was updated successfully, but these errors were encountered: