Forbidden (403) & corrupt image when removing original
-
Hi team Delicious Brains,
I’ve been running into a very peculiar issue since a few weeks now. If I keep the switch ‘Remove files from server’ on, it will result in a corrupt image and a 403 Forbidden error in my error.log
Setup:
– Cloudflare: s.mydomainname.nl
– Amazon S3 bucket: s.mydomainname.nl with bucket policy as stated by Cloudflare, static website disabled.
– Offload Media, setup with Cloudflare as CDN
– Smush Pro for optimisationSteps:
– Upload a new (hi-res) image
– All different sizes (including the original) get smushed copied to S3
– All sizes are removed from the server perfectly except for the orginal and the new “-scaled”-version that WordPress has generated for me.
– That “scaled”-version is the new default size in the database, but when I copy the S3 link to that file, the image is corrupt (243b size, shows a blank square in the browser)
– If i copy the link to the original image on S3, it’s available as well.
– If i look at the error log of my server, it shows an XML-error, Acces Denied by Amazon. Apparently, there was an attempt to execute GetObject to ‘s3.amazonaws.com.s.mydomainname.nl/wp-content/uploads/2020/11/file.jpg’ – which also throws a 403 in the browser.If I disable the option to remove files from the server, the whole process works flawless. Except that I don’t want my server to fill up with images… ??
I’ve been trying loads of things, including an extra statement to the bucket policy granting the IAM user for this job access as well, but to no avail.
Any help would be largely appreciated!
Cheers,
- The topic ‘Forbidden (403) & corrupt image when removing original’ is closed to new replies.