Version 3.1.1. points to the wrong endpoint.
Here is the message from Amazon:
<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>mybucket</Bucket>
<Endpoint>mybucket.s3.amazonaws.com</Endpoint>
Pointing to the following link:
s3.amazonaws.com/mybucket/images/avatar/...8c14b4488bf85afa.jpg
Should be pointing to:
mybucket.s3.amazonaws.com/images/avatar/...8c14b4488bf85afa.jpg
Please change it back to the correct way!
Hi, Rick Villela.
Find this file (WARNING! This is a core hack! Please make a safe copy before editing and copy after customization as this file could be overwritten after upgrade)
ROOT/components/com_community/libraries/storage/s3.php
and in line 110 change this:
if ($uri->isSSL()) {
return 'https://s3.amazonaws.com/' . $this->bucket . '/' . $item->resource_path;
} else {
return 'http://s3.amazonaws.com/' . $this->bucket . '/' . $item->resource_path;
}
}
if ($uri->isSSL()) {
return 'https://' . $this->bucket . '.s3.amazonaws.com/' . $item->resource_path;
} else {
return 'http://' . $this->bucket . '.s3.amazonaws.com/' . $item->resource_path;
}
Yes, I did what you mentioned as well as a change to ROOT/components/com_community/libraries/storage/s3_lib.php lines 1142 & 1143:
from:
// $hostBucket ? $bucket : $bucket.'.s3.amazonaws.com', $uri, self::$__accessKey, $expires,
$hostBucket ? $bucket : self::$endpoint.'/'.$bucket, $uri, self::$__accessKey, $expires,
$hostBucket ? $bucket : $bucket.'.s3.amazonaws.com', $uri, self::$__accessKey, $expires,
// $hostBucket ? $bucket : self::$endpoint.'/'.$bucket, $uri, self::$__accessKey, $expires,
Hi there,
Actually i do that change. I have read S3 document but infact it's different. I'm not quite sure what are you configured in your S3 ?
Please try to check this one:
http://s3.amazonaws.com/JomSocialS3/images/photos/921/3/thumb_459822d637117c186a6bfbf5.jpg
s3.amazonaws.com/<bucket>/<id>
It's the difference between
virtual-style (
yourbucket.s3.amazonaws.com/yourobject
) and
path-style (
s3.amazonaws.com/yourbucket/yourobject
) buckets.
It looks like Amazon is trying to standardize on Virtual Style.
docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
We recommend that all bucket names comply with DNS naming conventions. These conventions are enforced in all regions except for the US Standard Region. DNS compliant bucket names allow customers to benefit from new features and operational improvements, as well as providing support for virtual-host style access to buckets.
Hi, Rick.
Please upgrade to current version of JomSocial -> JomSocial 3.2.0.1 and check if issue still persist.