serverless-image-handler: Http response code: 413
I’m having 2 weeks conversation with AWS support, but without any results, hope somebody here will help me figure out what is going on.
Initial problem: for some images I’ve receive Internal server error
with [ERROR] [1583405456446] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413.
on CloudWatch.
But, also I found today, that behaviour is much more odd, that I thought 2 weeks ago.
this link opens for Chrome, Firefox, Opera browsers (on different devices), but doesn’t for Safari.
Looks like this image has been processed by CloudFormation (main question how?, because now I receive 413) and saved on CloudFront. But for some browsers it receives from the CloudFront, but for Safari it tries to proceed it again.
Of course main goal to fix 413 error, or at least found any workaround. I’m using latest template https://s3.amazonaws.com/solutions-reference/serverless-image-handler/latest/serverless-image-handler.template
Any thoughts? Will be very appreciate for any ideas.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 18 (8 by maintainers)
@vitalinfo I’m sorry for your inconvenience. I think the reason why you got 413 error is that your image size is pretty big, so it could exceed the AWS Lambda’s invocation payload limit.
We will review the workaround or solution for this issue.
Thanks for waiting. We’ve released v5.1.0 to mitigate this issue. The new version will throw an proper error message once your images exceed the Lambda limit.
@vitalinfo @demsey2 since we are using API Gateway Lambda proxy, we are encoding the image binary which causes bigger payload than the original image size. That’s why you’ve faced an issue with images lower than the Lambda limit.
@beomseoklee I’ve faced with new problem I’ve an image: and when I try to apply such edits
it crashed with 413 error any ideas how to prevent such crashes? thanks
@vitalinfo Oh, you increased the size of the image, and I can see that the output of the image became around 8MB with your edits. That’s why you get the 413 error.
The workaround can be put the output image to an Amazon S3 bucket, and load the image from the bucket. We will think about the best way so that everyone would be happy.
Once again, I’m sorry for your inconvenience.