AWS s3 in Frankfurt
Hello, when creating a new S3 bucket in Frankfurt, OC (ownCloud 7.0.2) files_external give error, instead with a bucket in Ireland is well working. Reading AWS documentation I have found: "Any new regions after January 30, 2014 will support only Signature Version 4" cfr: http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html There is some trouble with this new region ? Regards, Filippo
@butonic
Not sure, but I noticed before that the S3 library got upgraded on master, maybe it already works there.
No, but upgrading to the latest AWS SDK for PHP (2.7.3) and with the right region (eu-central-1) it works. Without region doesn't work.
Do you mean the S3 external storage should auto-detect the region ? From what I saw in the code the default is always "eu-west-1" if no region is specified: https://github.com/owncloud/core/blob/master/apps/files_external/lib/amazons3.php#L111
Excuse my English, but what I mean are two thinks:
- With the original (of OC) aws library there is an error mounting S3 bucket "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256" this because new region,like eu-central-1, will support only Signature Version 4. This could be fixed upgrading external lib to AWS SDK for PHP version 2.7.3.
- I don't know if the library could auto-detect the region, but now in Europe there are two region: eu-central-1 and eu-west-1, probably with different privacy laws. From the user point of view on the GUI there is "region (Optional)" but it is not optional using the region eu-central-1,because without insert the region the mounting process not works.
So I guess we should make "Region" a mandatory field for S3 ?
It looks like on master the AWS SDK is currently on version 2.6.15, which was upgraded recently by @helmutschneider
I am not up to speed regarding the new eu region or its sdk-requirements.. but I can certainly upgrade master to 2.7.3 since it appears to be fully backwards-compatible :)
@helmutschneider that would be awesome, thanks :smile:
It appears the aws sdk has problems with the new V4 signatures no matter which version you are using. Just tested 2.7.3 against eu-west-1 and it ran perfectly - against eu-central-1, not so much. 16 tests fail with the following error:
Aws\S3\Exception\S3Exception: AWS Error Code: XAmzContentSHA256Mismatch, Status Code: 400, AWS Request ID: 85B46F11CF55B606, AWS Error Type: client, AWS Error Message: The provided 'x-amz-content-sha256' header does not match what was computed., User-Agent: aws-sdk-php2/2.7.3 Guzzle/3.8.1 curl/7.37.1 PHP/5.5.14
Also found this: aws/aws-sdk-php#393
The amazon guys quickly fixed the issue :) PR done
Wow, very cool :smile: Thanks a lot for sorting this out!
Will be fixed with 8.0
S3 buckets locatet in Frankfurt do not work with owncloud 8.0 - only if you add "eu-central-1" as region ...I guess this behaviour isn't bulletproof as you don't have to add that information for, let's say, a bucket locatet in Ireland.
Still ?
Can you post your log ?
UPDATE: Apologies on the below, I accidentally added the region to the credentials array when initializing. All good now.
~~Same. Here's what I get:~~
~~PHP Fatal error: Uncaught Aws\S3\Exception\InvalidRequestException: AWS Error Code: InvalidRequest, Status Code: 400, AWS Request ID: 054C4849D34356DB, AWS Error Type: client, AWS Error Message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256., User-Agent: aws-sdk-php2/2.7.21 Guzzle/3.9.2 curl/7.22.0 PHP/5.3.10-1ubuntu3.15 ITR thrown in /user/src/aws/aws_client/Aws/Common/Exception/NamespaceExceptionFactory.php on line 91~~