Forem Creators and Builders 🌱

Discussion on: Image upload configuration issue

 
djuber profile image
Daniel Uber

Thanks for the extra detail - yes - if this is happening for both body image upload and cover image upload it's a separate issue from the url validation you initially described.

I would suspect the error could be raised by Traefik rather than rails, based on one of the settings shown here doc.traefik.io/traefik/middlewares... - but I don't see that we enable the "buffering" middleware in the traefik config so I'm less confident of that. One other possible culprit could be rack (the ruby web application framework) or puma ( the actual http server process) but I'm not seeing anything obvious there that would raise a payload too large error when handling uploads. I do see the openresty nginx configuration explicitly sets max body size to 0 - which overrides the default of 1MB.

This definitely does not happen locally in development (I am able to upload a 1.78MB JPG file and it's saved correctly) with just puma listening on port 3000, so it's unlikely to be the forem code (rather than something "upstream" in the request cycle, like traefik or nginx).

Thread Thread
 
9comindia profile image
9comindia • Edited

Superb @djuber , this really helped me.
I don't have traefik and openresty in my local environment, just the nginx.
After setting "max body size to 0" in nginx, the error is gone.
thank you very much.

And the url validation issue was resolved when replaced "development" to "production" in files wherever I found development.

I am yet to find a proper way to run "bin/rails s -p 3000 -b 0.0.0.0" in production, which is starting the rails in development environment.