-
-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repeated bucket name in the URL on AWS and issue with :path_style #228
Comments
The error with path-style false may have to do with the bucket name including underscores, as I think this might not match with the wildcard SSL on s3. I'm uncertain about the repeated domain names though. Someone within the carrierwave project may better be able to help there as I don't think it has to do with fog itself, so much as the integration. |
Hi Geemus! Thanks for the reply. |
Ah, thanks for that clarification. I knew that sometimes particular names conflicted with the wildcard cert S3 uses, but it doesn't sound like that is the case here after all. Were you able to get in touch with anybody from carrierwave to offer advice? I haven't worked with it in such a long time I worry I may be missing something obvious. Thanks! |
Any progress with this? |
Same issue here, is there any fix known? |
It turned out that I had wrong region in configuration. Changing ragion fixed the issue. |
Yeah, when this issue occurs it usually relates to a failed attempt to follow redirects when the region is set incorrectly for the connection. Unfortunately, they are not true redirects, just a series of inconsistent error messages that we have done our best to turn into working redirects (sometimes it just works, but we have had a number of cases where it ends up doing things like this, unfortunately). Setting the region to match the file is a good way to avoid this issue altogether, otherwise I would welcome help improving the redirect code (but know that I've spent a lot of time struggling with it and not had much luck improving the situation due to various inconsistencies and the difficulty to test all the possibilities). |
I'm not sure if this is 100% the OP's issue but from what I can see S3 has changed how it's region redirects occur. Previously if you used a path_style request it would go from s3.amazonaws.com -> eu-west-1.s3.amazonaws.com and make the request again. Instead now it seems to redirect from s3.amazonaws.com -> bucketname.s3.amazonaws.com. Because of this Fog can't recognise the region and will continue to sign with the wrong region (us-east-1) by default. It seems like this differs from the logic in the redirect code, as stated, or at least there needs to be a new detection method for signing with the wrong region in addition to what is already present. |
@scsmith that could very well be. The behavior I saw in the past was that different requests redirected in different ways (which made it really hard to debug or workaround), perhaps that is no longer the case though. |
@scsmith Thanks bro 😃 |
I'm have the same issue. |
@lustan3216 yeah, there have definitely been some weird edge cases relating to redirection. Glad you found a fix and thanks for taking time to share details. |
This issue has been marked inactive and will be closed if no further activity occurs. |
I am trying to set fog for aws for my rails application, together with CarrierWave.
I created a CarrierWave initializer with al the settings needed.
Files are uploaded without problem in my S3 bucket but there are still two things to fix:
For example:
The real link of the image (retrieved from the bucket control panel) is:
https://s3.eu-central-1.amazonaws.com/my_bucket_name/my_bucket_name/my_bucket_name/uploads/restaurant/gallery/1/image.jpeg
While in my model the image is saved as:
https://my_APP_name.s3.amazonaws.com/uploads/restaurant/gallery/1/image.jpg
Which is the non styled url (but I explicitly declared
:path_style => true
)I tried to change :path_style to false but in that case amazon retrieves me this error:
hostname "my_bucket_name.my_bucket_name.s3.eu-central-1.amazonaws.com" does not match the server certificate (OpenSSL::SSL::SSLError).
I sincerely have no clue about how to fix it.
I attach here the configuration file which I believe is fine. Thanks everybody for the support.
PS: "my_bucket_name" and "my_app_name" are fantasy names just to help explaining the issue and they are not the real names. Anyway, real names are composed exclusively of lowercase letter.
The text was updated successfully, but these errors were encountered: