question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection refused, ending in timeout lambda

See original GitHub issue

Describe what happened: We’re monitoring all lambda errors in our account, and thus we monitor the datadog lambda (version 1.5.0) as well. We see reoccurring failures i.e. at least once a day.

Looking through the cloudwatch logs, this is what I see:

[Errno 111] Connection refused: error
Traceback (most recent call last):
File "/opt/python/lib/python2.7/site-packages/datadog_lambda/wrapper.py", line 58, in __call__
return self.func(event, context)
File "/var/task/lambda_function.py", line 380, in datadog_forwarder
forward_logs(filter_logs(logs))
File "/var/task/lambda_function.py", line 402, in forward_logs
with DatadogClient(cli) as client:
File "/var/task/lambda_function.py", line 193, in __enter__
self._client.__enter__()
File "/var/task/lambda_function.py", line 242, in __enter__
self._connect()
File "/var/task/lambda_function.py", line 215, in _connect
sock.connect((self.host, self.port))
File "/usr/lib64/python2.7/ssl.py", line 864, in connect
self._real_connect(addr, False)
File "/usr/lib64/python2.7/ssl.py", line 851, in _real_connect
socket.connect(self, addr)
File "/usr/lib64/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused

Followed by a REPORT log entry saying the lambda consumed all the allocated time.

Describe what you expected: I expect the lambda not to fail. Not at such a high rate anyway.

Steps to reproduce the issue:

Given the high failure rate, I presume this is smth that happens to everyone.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cbanciu667commented, Sep 19, 2019

Hi @andreineculau I struggled for some day with the same error until i switched to Python3.6 and latest lambda layer version in my region (arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python36:5). After that everything worked as expected.

0reactions
tianchucommented, Nov 6, 2019

@andreineculau I hope you have resolved the issue with our support team, and I’m going to close this issue. Feel free to reopen if you still need help from us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Lambda function retry and timeout issues when ...
A low Lambda function timeout can cause healthy connections to be dropped early. If that's happening in your use case, increase the function ......
Read more >
How do I troubleshoot timeout errors from Lambda ... - YouTube
How can I troubleshoot connectivity to an RDS instance that uses a public/private subnet of a VPC? · AWS Troubleshooting | AWS lambda...
Read more >
AWS Lambda RDS connection timeout - Stack Overflow
When you run from lambda this rule blocks traffic. Check out your db error logs and you can confirm it is refusing the...
Read more >
Debugging AWS Lambda Timeouts - Lumigo
Lambda does not report a separate error metric for timeouts, so timeout errors are bundled with other generic errors. Lambda functions often ...
Read more >
Lambda Task Timed Out After X Seconds - Dashbird
The naive solution for this problem is dialing up the timeout in the function's configuration. After all, Lambda's upper limit for timeouts is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found