Cannot upload file from device


#1

Hello,

I recently facing a problem trying to upload a file from a device. Everything seems to work but the path to the image seems to be broken:

image
image.png938x106 9.64 KB

The url is something like this:
https://bucket.s3.dualstack.us-east-1.amazonaws.com/original/2X/f/f0e2abfafe5f70b469b8acb3561632b6578a0d2f.jpeg

However if I remove the dualstack.us-east-1 part from the url, it’s working. I am not sure if any recent update changed this and how to fix this?

Thanks a lot for your help.


#3

Hello,

I have rebuild the app but I am still getting a Error 504 Gateway time-out.

Any hint on how to solve the problem? Users can’t upload files anymore :frowning:

Thanks for your help.


#4

Also when I try to open the link of the image once uploaded, I am getting this error:

<Error>
<Code>PermanentRedirect</Code>
<Message>
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
</Message>
<Bucket>bucketname</Bucket>
<Endpoint>
bucketname.s3.dualstack.eu-west-1.amazonaws.com
</Endpoint>
<RequestId>F8890582BD602345</RequestId>
<HostId>
zVe7lYBNImLVmY2nDbsvVxXDFD3ADFAgmyeenqgYMamKYzrt2/nFJQPVcINcenPmk=
</HostId>
</Error>

(Jeff Atwood) #6

Didn’t we fix a bug around this @tgxworld @sam?


(Sam Saffron) #7

I don’t understand the op, what URL works? What URL does not?


#8

Hi @sam,

Sorry for the confusion, so when I try to upload a file, I sometimes have errors 504, but when the process go through, here is what I have:

Then when I try to open the image:
image

It’s sending me to this URL:

https://[BUCKETNAME].s3.dualstack.us-east-1.amazonaws.com/original/2X/5/515af803b35589375499728450daa16944ac1c93.jpeg

where I have:

<Error>
<Code>PermanentRedirect</Code>
<Message>
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
</Message>
<Bucket>[BUCKETNAME]</Bucket>
<Endpoint>
[BUCKETNAME].s3.dualstack.eu-west-1.amazonaws.com
</Endpoint>
<RequestId>D4890582BD592611</RequestId>
<HostId>
zVe7lYBNImLVmYeig2nDbsvVxXw3knzOs7bnksKwGQDAgnqgYMamKYzrt2/nFJQPwexINcenPmk=
</HostId>
</Error>

So when I change manually the part of the URL us-east-1 to eu-west-1 as mentioned in the error message, the url is actually working.

My bucket was created in EU (Ireland) and when I check the documentation on Amazon’s website, I can see that:


which makes sense with the previous error message.

And in my configuration, I have:

The only thing I haven’t change is this parameter which seems to be quite new, I don’t remember seeing it before and from all the posts I have seen online, they never mentioned anything about it:

So it seems that the file upload is kinda working, the file is being uploaded but Discourse is not using the correct URL to display the image, it’s using the wrong REGION name.

Thanks for your help.