Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Upgrade to 3.1.1 breaks remote storage (Amazon S3)

10 years 2 months ago
  • Rick's Avatar
    Topic Author
  • Rick
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

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!

10 years 1 month ago
Licenses:

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;
            }
        }

to this:
            if ($uri->isSSL()) {
                return 'https://' . $this->bucket . '.s3.amazonaws.com/' . $item->resource_path;
            } else {
                return 'http://' . $this->bucket . '.s3.amazonaws.com/' . $item->resource_path;
            }

Save and check if it works for you.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
10 years 1 month ago
  • Rick's Avatar
    Topic Author
  • Rick
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

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,
to:
$hostBucket ? $bucket : $bucket.'.s3.amazonaws.com', $uri, self::$__accessKey, $expires,
// $hostBucket ? $bucket : self::$endpoint.'/'.$bucket, $uri, self::$__accessKey, $expires,

After making those changes, it seems to be working as before.
I just wanted to make sure it got into the next revision.
Thanks

The following user(s) said Thank You: T
10 years 1 month ago
Licenses:
JomSocial Expired

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>


Thank you.
PS:// I'm not sure above path would include in our next release until we find out root cause.

10 years 1 month ago
  • Rick's Avatar
    Topic Author
  • Rick
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

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.


See docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html

10 years 2 weeks ago
Licenses:

Hi, Rick.

Please upgrade to current version of JomSocial -> JomSocial 3.2.0.1 and check if issue still persist.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW