latest git breaks ja_amazons3 component

prophoto

Active Member
I think I've narrowed the errors I've been seeing in my CCB site down to fabrik. I updated from git to fix an issue with date picker when filtering. That was fixed, but now I can't upload files to S3 via ja_amazons3 component. I get the following error message:

An error has occurred.
0 Missing required client configuration options: version: (string) A "version" configuration value is required. Specifying a version constraint ensures that your code will not be affected by a breaking change made to the service. For example, when using Amazon S3, you can lock your API version to "2006-03-01". Your build of the SDK has the following version(s) of "s3": * "2006-03-01" You may provide "latest" to the "version" configuration value to utilize the most recent available API version that your client's API provider can find. Note: Using 'latest' in a production application is not recommended. A list of available API versions can be found on each client's API documentation page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are unable to load a specific API version, then you may need to update your copy of the SDK.

This does not happen with other sites on the same server running earlier versions of Fabrik and the same version of ja_amazons3. I tried disabling fabrik package but the following files are still being loaded and shown in Joomla debug.

13 Aws\S3\S3Client->__construct() /var/www/example.com/httpdocs/libraries/fabrik/vendor/aws/aws-sdk-php/src/AwsClient.php:322
14 Aws\AwsClient->__construct() /var/www/example.com/httpdocs/libraries/fabrik/vendor/aws/aws-sdk-php/src/S3/S3Client.php:243
15 Aws\ClientResolver->resolve() /var/www/example.com/httpdocs/libraries/fabrik/vendor/aws/aws-sdk-php/src/AwsClient.php:158
16 Aws\ClientResolver->throwRequired() /var/www/example.com/httpdocs/libraries/fabrik/vendor/aws/aws-sdk-php/src/ClientResolver.php:260
 
Ah, they must use the Amazon AWS SDK. I had to update our S3 adapter for the upload element to use the SDK, as the old simple 3rd party class we were using doesn't work with newer S3 regions, due to changes in the authentication mechanism.

So obviously ja_amazons3 uses a different version of the library.

I'll have to load up that component, and see if I can match versions.

-- hugh
 
Meh, it's a paid download.

Can you catch me on Skype and send me the installer. I'll send them a request for a dev copy (which I know they'll give me, they've always been very good about giving me access to their stuff for integration work) but it'll take a day or two.

-- hugh
 
Hmmm, just looking at my code, I suspect this may be an issue with their code not providing a version string rather than mine, and they may be using an earlier version of the SDK. But because our system plugin is loading first, it's setting up our autoloader for the Composer library, so their code is probably now using my library.

Anyway, I'll still need to install their code to figure it out.

-- hugh
 
OK, to sum up our Skype conversation.

They use the old v2 SDK. Because we both autoload the Amazon SDK, and because Fabrik's system plugin runs first, their code is now instantiating the S3 class from our v3 library.

Fortunately, there is not a huge amount of difference in the S3 API between v2 and v3. So I've been able to tweak their code and get their stuff working with v3 - at least as far as adding accounts, buckets, and uploading to S3. haven't tested the actual front end stuff yet, but I don't anticipate too many problems.

I've sent a note to their operations manager, to suggest he puts me in touch with their devs, and we figure out getting their code updated to use v3.

-- hugh
 
We are in need of some funding.
More details.

Thank you.
Back
Top