Problem using Exoscale as an external host for media storage

Hi all, i think i’m going nuts. :face_with_head_bandage:

I’m trying to use Exoscale for my Mastodon instance’s media storage. I signed up, created bucket, transferred all media files to that bucket, and enabled S3 in .env.production:


Oh yeah i followed this guide

Everything works fine, the site pulls all media files from that bucket.
BUT. It fails uploading new media files to that bucket.
For example when i try and just create a new toot and upload an image, i get this in the logs:

method=POST path=/api/v1/media format=html controller=Api::V1::MediaController action=create status=500 error='Seahorse::Client::NetworkingError: Failed to open TCP connection to (getaddrinfo: Name or service not known)' duration=722.12 view=0.00 db=23.13

Why does it use and not the host i provided in S3_HOSTNAME?

I tried commenting out S3_REGION, and then got:

method=POST path=/api/v1/media format=html controller=Api::V1::MediaController action=create status=500 error='Aws::S3::Errors::InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.' duration=1410.25 view=0.00 db=50.97

That key definitely exists.

Maybe any of you have an idea what is going wrong here?
Thanks so much in advance!


Mastodon is using a library called “paperclip” to talk to the S3 storage.

I don’t know how Exoscale is supposed to work, but here is an explanation about how the URLs for the storage calls are being constructed:

If S3_ENDPOINT is given there is an additional logic using S3_OVERRIDE_PATH_STYLE variable:

Maybe this is something you can start with

Thanks for the hint! I’m still unsure what i did wrong (if anything) though.

In the meantime i just created a good ole S3 bucket on AWS and things worked on first try. I’ll just go with that for the time being.

AWS is widely used. I think there are some configuration tweaks that may be needed to get it work, maybe there are other that did configure this successfully?

Apparently in addition to S3_HOSTNAME, S3_ENDPOINT must also be set (i did not do that)

S3_ENDPOINT is what Mastodon will use to upload files. S3_HOSTNAME is what will be used in the user’s browser. Both are required.

This is a quote from here: (it’s Wasabi specific, but should apply to Exoscale too).

I’m gonna test if that solves it later tonight.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.