aws-samples / image-optimization

Simple, performant and cost efficient solution for optimizing images using Amazon CloudFront, Amazon S3 and AWS Lambda
MIT No Attribution
172 stars 106 forks source link

Got Internal Server Error #7

Closed stonesthatwhisper closed 7 months ago

stonesthatwhisper commented 1 year ago

After deploying this I got Internal Server Error when accessing:

https://\<my-distribution>.cloudfront.net/images/rio/1.jpeg?format=auto&width=300

What's the difference between this repo with https://github.com/aws-solutions/serverless-image-handler

they do look similar but I would appreciate a comparison.

achrafsouk commented 1 year ago

Hello, in the HTTP response of the failed request, you will find the 'X-Amz-Cf-Id' Header. Can tou share the value of it? It will help me troubleshoot the issue.

Compared to the Serverless Image Handler, this architecture is optimized for end user delivery thanks to cache normalization, temporary storage with S3, and lower delivery cost without the API Gateway layer.

achrafsouk commented 1 year ago

FYI, I just deployed the stack again, and tested the same URL, i didn't have the issue you mention

achrafsouk commented 1 year ago

Maybe you are curling with a HEAD HTTP request? -I ? it's not allowed in the code, you can change it if you want.

davidvanleeuwen commented 11 months ago

Testing out what you've build and I actually have the same problem as @stonesthatwhisper. It seems to be an issue with the way you include sharp.

image

I haven't done a lot lately AWS. I'll check if I can fix this myself.Not sure how dependencies are taken care of with CDK/lambda these days.

davidvanleeuwen commented 11 months ago

Ah lol, just forgetting to run npm run build 🤦