Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large files cause "body size too long" error #35

Closed
isTravis opened this issue Jul 8, 2018 · 13 comments
Closed

Large files cause "body size too long" error #35

isTravis opened this issue Jul 8, 2018 · 13 comments

Comments

@isTravis
Copy link

isTravis commented Jul 8, 2018

Transforming a large (9.8MB) gif causes a body size too long error. This seems related to the 6MB body payload size, as described in the Lambda Limits page. I think this issue will face image formats other than .gif, that's just what I've seen it pop up on. Log screenshot below.

Any advice for how to work around this?

At the moment, I have an onError function on my <img /> tags that replaces the src with the original non-resized URL. But - this occurs in the worst case scenario, where we have huge files - so it's really not desirable.

screen shot 2018-07-08 at 10 10 04 am

@gsingh04
Copy link
Member

I was able to replicate this behavior. As you correctly pointed out, I believe here Lamdba response payload size is causing the issue. It should not be more than 6MB as per the limits page.
Would saving image on S3 and returning that url in response rather than the actual image be a valid work around?
Refer here for details: https://github.com/thumbor-community/aws#result-storage-settings
We can explore tc_aws.result_storages.s3_storage for this use case.

@khawerrind
Copy link

Hi, Any update on this issue or did someone figure out the solution to this issue?

@hayesry
Copy link
Member

hayesry commented Feb 26, 2019

Hi all. We're currently updating the solution and are looking into output storage to an S3 bucket (either a default bucket or specified in the request) as a workaround to the Lambda payload limit. Thanks for your feedback/patience!

@onassar
Copy link

onassar commented May 8, 2019

I just ran into this with a JPEG unfortunately (reference here: https://docs.aws.amazon.com/lambda/latest/dg/limits.html)
Only recommendation I can give is for people to use the filters:quality(40) URL param option in cases where the image fails to load.

It's a bummer, and I'll post back if I come up with any other clever approach to this.

@brik-dm
Copy link

brik-dm commented May 8, 2019

@hayesry any update on the workaround?

@hayesry
Copy link
Member

hayesry commented Jun 13, 2019

We have added this as a feature request to our backlog for an upcoming release, but don't have an ETA for when it will be ready. Marking the ticket for closure in the meantime.

@onassar
Copy link

onassar commented Jun 14, 2019

Thanks @hayesry
Really looking forward to this; it's been a tough one to work around :(

@stewones
Copy link

that's sad we're trying to deploy a storybook and there's a js file which exceed just 300kb 🤦🏻‍♂️ . it's a vendor file chunk so we can not even try to cut something off to reach out the 5mb limit. zeit/now is pure love but for this reason we're having to host in another place.

@videoAbyss
Copy link

that's sad we're trying to deploy a storybook and there's a js file which exceed just 300kb 🤦🏻‍♂️ . it's a vendor file chunk so we can not even try to cut something off to reach out the 5mb limit. zeit/now is pure love but for this reason we're having to host in another place.

where are you hosting this now ? If not zeit/now ?

@stewones
Copy link

stewones commented Aug 7, 2019

@videoAbyss we’re using a static server. For now firebase hosting

@pbirsinger
Copy link

My json data response is 750kb (<<5MB). Why am I also getting this error? @stewwan if your file is 300kb why do you get the error too?

dylanfisher added a commit to dylanfisher/forest that referenced this issue Jun 16, 2021
This avoids an issue where if e.g. an image derivative is too large for
the serverless image handler, only that single derivative will fail
to process.

This issue was happening when uploading large PNG files. Now, thumb,
small, and medium derivatives should still continue to process, while
large sizes may fail.

Shrine: Creating derivatives concurrently
https://shrinerb.com/docs/processing#c-creating-derivatives-concurrently

Large files cause "body size too long" error
aws-solutions/serverless-image-handler#35
@redayoub
Copy link

Hi, any updates about this ?

@fisenkodv
Copy link
Contributor

@redayoub have this feature in our backlog, please follow #322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests