Failed to send data to X-Ray daemon. OSError: [Errno 90] Message too long

See original GitHub issue

I am trying to use aws-lambda-powertools in my lambda function and when I run my lambda function, it came out with this error but my lambda function still able to run and complete. I suppose version 1.17.0 has already included streaming_threshold=0 but I would still get the same error with Message too long.

What were you trying to accomplish? I would like to know if there is anyway to fix this issue without disabling x-ray tracing in my lambda function. What configuration or workaround I can have?

Environment

  • Powertools version used: 1.17.0
  • AWS Lambda function runtime:: Python 3.7

Logs

[ERROR]	2021-06-11T16:37:43.245Z	e949c1fb-fb68-41c3-a77d-736cef47ec04	Failed to send entity to Daemon.
Traceback (most recent call last):
  File "/opt/python/aws_xray_sdk/core/emitters/udp_emitter.py", line 41, in send_entity
    self._send_data(message)
  File "/opt/python/aws_xray_sdk/core/emitters/udp_emitter.py", line 63, in _send_data
    self._socket.sendto(data.encode('utf-8'), (self._ip, self._port))
OSError: [Errno 90] Message too long

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
heitorlessacommented, Jun 14, 2021

I was thinking this over the weekend and one possibility is that the response returned by the handler or decorated function is bigger than 64K it reproduces this issue - that’s because we automatically serialize and capture response and exceptions from decorated functions.

If that’s the case, could you try disabling this feature to see if that solves it?

Docs: https://awslabs.github.io/aws-lambda-powertools-python/latest/core/tracer/#disabling-response-auto-capture

from aws_lambda_powertools import Tracer

@tracer.capture_method(capture_response=False)
def fetch_sensitive_information():
    return "sensitive_information"

@tracer.capture_lambda_handler(capture_response=False)
def handler(event, context):
    sensitive_information = fetch_sensitive_information()

Thank you!

2reactions
ShengHow95commented, Jun 15, 2021

Alright cool. Thanks alot for your assistance @heitorlessa!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting AWS X-Ray
This error indicates that the X-Ray SDK attempted to record an outgoing call to AWS, but couldn't find an open segment. This can...
Read more >
AWS X-Ray SDK for PythonでOSError: [Errno 90] Message too ...
RDBに保存されたデータを集計し、集計後のデータを再度RDBに書き戻すような処理を実行しています。このLambdaのログに Failed to send entity to Daemon.
Read more >
PyLepton_capture got [Errno 90] Message too long
I guess your problems comes from using Lepton 3.x, which takes lager resolution images than Lepton 2.x (160x120 vs 80x60). If so, first...
Read more >
Logging error: [Errno 90] Message too long #389 - Explore
... in emit self.socket.send(msg) OSError: [Errno 90] Message too long During handling of the above exception, another exception occurred: Traceback (most ...
Read more >
aws - Bountysource
Created 3 years ago in aws/aws-xray-sdk-python with 11 comments. ... Error when serializing segment causes invalid message to be sent to the daemon...
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