Closed andrew-stclair closed 3 months ago
Hello,
It seems that some (not all) requests to the lambda function get base64 encoded, breaking the function and causing a 502 error.
I've done some digging and found that requests that work are like this:
{ ... "body": "{\"execution_mode\": \"get\"}", "isBase64Encoded": "False" }
But sometimes instead i get this:
{ ... "body": "J3tleGVjdXRpb25fbW9kZTpnZXR9Jw==", "isBase64Encoded": "True" }
If i add some code to decode that base64, it returns invalid json:
'{execution_mode:get}'
thanks @andrew-stclair is this happening with the same request getting this inconsistent behavior or is there a specific DNS name causing this? Do you have any non alphanumeric character in your domain name?
Same request, always the first one it seems, subsequent requests seem to work as expected. I think it may be related to cold starts.
DNS address has standard english characters in it, nothing non alphanumeric.
I have made a temporary workaround by doing two get calls to the lambda, ignoring the first one.
Same request, always the first one it seems, subsequent requests seem to work as expected. I think it may be related to cold starts.
DNS address has standard english characters in it, nothing non alphanumeric.
I have made a temporary workaround by doing two get calls to the lambda, ignoring the first one.
I will try to replicate the issue, can you confirm which Python runtime is set on your Lambda function? Also, do you use the provided bash script to call the function or you use another method?
My lambda function is on python 3.12
And i'm using the provided script, but first calling the lambda function via a get request before doing so.
cannot replicate
Hello,
It seems that some (not all) requests to the lambda function get base64 encoded, breaking the function and causing a 502 error.
I've done some digging and found that requests that work are like this:
But sometimes instead i get this:
If i add some code to decode that base64, it returns invalid json: