Comments (5)
I have added some traces in client.py in _make_api_call and I have compared the request in local and in the lambda and, in effect, the lambda request includes the X-Amzn-Trace-Id
header while the local one does not have it.
Local request_dict["headers"]
:
{
"X-Amz-Target": "Logs_20140328.StartLiveTail",
"Content-Type": "application/x-amz-json-1.1",
"User-Agent": "Boto3/1.34.90 md/Botocore#1.34.90 ua/2.0 os/linux#6.5.0-28-generic md/arch#x86_64 lang/python#3.11.9 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.90"
}
Lambda:
{
"X-Amz-Target": "Logs_20140328.StartLiveTail",
"Content-Type": "application/x-amz-json-1.1",
"User-Agent": "Boto3/1.34.90 md/Botocore#1.34.90 ua/2.0 os/linux#5.10.210-220.855.amzn2.x86_64 md/arch#x86_64 lang/python#3.11.9 md/pyimpl#CPython exec-env/AWS_Lambda_python3.11 cfg/retry-mode#legacy Botocore/1.34.90",
"X-Amzn-Trace-Id": "Root=1-662a3481-efba1490ff83e13eba5c4a88;Parent=30359a3e11333b80;Sampled=0;Lineage=bcaff313:0"
}
from botocore.
I have detected when the header is added and it's in here:
def add_recursion_detection_header(params, **kwargs):
has_lambda_name = 'AWS_LAMBDA_FUNCTION_NAME' in os.environ
trace_id = os.environ.get('_X_AMZN_TRACE_ID')
if has_lambda_name and trace_id:
headers = params['headers']
if 'X-Amzn-Trace-Id' not in headers:
headers['X-Amzn-Trace-Id'] = quote(trace_id, safe='-=;:+&[]{}"\',')
And in the handlers.py we have:
('before-call', add_recursion_detection_header),
So the header is being included when we call any service from a Lambda, so, as far as I understand, this is a bug related with the service itself that it should accept the X-Amzn-Trace-Id
header. Am I correct?
from botocore.
Finally I get it working with a workaround, but it is not very elegant, I have set the _X_AMZN_TRACE_ID
environment variable to "" in my code before calling the start_live_tail operation.
os.environ["_X_AMZN_TRACE_ID"] = ""
I still think that this should be fixed in the service.
from botocore.
Hi @adrianicv thanks for reporting this issue. I agree that this seems like an issue with the service, specifically the CloudWatchLogs StartLiveTail API. Since APIs like this are used across AWS SDKs, I created a tracking issue for this in our cross-SDK repository: aws/aws-sdk#731. I'll reach out to the CloudWatchLogs team and try to find out more information regarding supporting that header. Please refer to that issue I created for updates going forward and thanks again.
from botocore.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
from botocore.
Related Issues (20)
- botocore still ignore "HTTP/1.1 100" HOT 2
- botocore/botocore/data/ssm-incidents/2018-05-10 /waiters-2.json = Formatted Differently than other waiters-2.json Files HOT 5
- WAFV2 PutLoggingConfiguration raising AccessDeniedException without naming required permissions HOT 2
- Occasional segfaults when using Client from multiple threads HOT 6
- sqs create_queue does not return `QueueUrl` since v1.34.90 HOT 5
- `boto3.client('wellarchitected').get_profile_template()` raises RuntimeError HOT 4
- Performance issue due to SSLContext being recreated over and over HOT 1
- OSError: [Errno 24] Too many open files causes CredentialRetrievalError HOT 3
- Client.head_object raises ClientError instead of NoSuchKey HOT 2
- Add support for fast fail when token bucket empty
- The request signature we calculated does not match the signature you provided: Check your AWS Secret Access Key and signing method HOT 2
- RecursionError through botocore/endpoint_provider.py:572 HOT 3
- Support environment variable for S3 addressing_style config HOT 3
- Add GlobalSign Root R6 to cacert.pem HOT 2
- Waiter documentation about error behavior is incorrect HOT 1
- Retry on `IllegalLocationConstraintException` HOT 2
- Stubber.add_response for query method validate against an invalid schema HOT 3
- datetime.datetime.utcnow() is deprecated as of Python 3.12 HOT 2
- Memory leak tests use substantially more memory on Python 3.13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botocore.