403 forbidden for thumbnails on s3 when running with CDN

AI-generated summary

403 Forbidden for Thumbnails on S3 with CDN

nodomain reported a 403 error when loading default user avatar images from an S3 bucket URL, despite the CDN setup working fine for other images. Falco suggested that the issue might be due to the unofficial AWS setup based on the aws-cdk-for-discourse project. However, nodomain clarified that the project uses the official Docker image.

After investigating, nodomain found the issue and restored a backup from another system. The problem was that the system was using the S3 URL for the default Discourse system user avatar image. nodomain didn’t have time to fix it due to ongoing testing activities.

A pull request to update the aws-cdk-for-discourse README is also in progress nodomain.

We use the official Docker hosting setup on AWS based on GitHub - aws-samples/aws-cdk-for-discourse: AWS CDK for Discourse · GitHub.

The general CDN setup works fine, e.g. images are delivered fine via CDN URL.

However the initial “32x32” request seems to go to the S3 bucket URL which yields a 403.

Did I miss a configuration bit or is it a bug?

That’s not official, as it’s an AWS project using a bitnami image for Discourse which we explicitly do not recognize as an official standard install of Discourse, making this outside of the scope of installs that we support here.

Not a bug as it’s not running the app the way we intend it to be ran, but it may be fixed with a config change. Maybe open an issue about this on the sample repository ?

The referenced project uses the official Docker image.
image

No Bitnami - I would not have used that in the first place either :wink:

I am going to dig into it and report an issue either there, or here.

Oh, sorry I went by what is written in the project README.md

Good luck. Please update here if you find any clues.

Pull request for README incoming :wink:

I found the issue. I restored a backup from another system.

What was broken then?

Somehow it used the s3 URL for the default Discourse system user avatar image. I did not spend time fixing it because I am still in progress of regularly recreating the environments due to some testing activities.