Amazon S3 does not work
Hello.
The Amazon S3 module does not work in version 6. I have tried the stable release as well as today's build. Here are the issues.
The following code in apps/files_external/lib/amazons3.php causes the error "Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method." (the access credentials are correct, I checked them via s3cmd and under v.5):
if (!$this->file_exists('.')) {
$result = $this->connection->putObject(array(
'Bucket' => $this->bucket,
'Key' => '.',
'Body' => '',
'ContentType' => 'httpd/unix-directory',
'ContentLength' => 0
));
$this->testTimeout();
}
I am not sure about this code purpose. I suppose, the connection should be checked via the headBucket() call. For example:
try {
$result = $this->connection->headBucket(array(
'Bucket' => $this->bucket
));
} catch (S3Exception $e) {
\OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR);
throw new \Exception("Check status : head bucket failed.");
}
Even if that code is changed, the folder, defined in setting, is not displayed in "Files". I.e. the storage is not accessible.
All this is working fine in the latest version 5. So, it appears that something was broken in v.6.
Also, as a small Amazon S3 module improvement, I would suggest the SSE option implementation.
http://docs.aws.amazon.com/AmazonS3/latest/dev/SSEUsingPHPSDK.html
It's quite simple and does not require significant code changes.
@isdn I got this as well trying to access a US bucket from Europe... @ser72 was able to access it directly from the US.
Strange that it does work in OC 5 for you.
@PVince81 I used the same bucket in eu-west-1 in both cases (and I am accessing it from Europe) with OC5/OC6. I also tried setting the region and/or hostname explicitly to point OC6 to the right region, but this didn't help. PS: As for the server config - I checked this on two servers - one is a live VPS (nginx + PHP 5.5.3), and the other is a VM on my laptop (Apache + PHP 5.5.3).
I have the same issue. Strange thing is, on an Amazon EC2 instance with owncloud 6.0.0 adding an S3 external storage worked flawlessly. I installed a new EC2 instance with owncloud 6.0.0 a while ago, and the same night I also installed owncloud on a VPS from a different provider. This gave me the error mentioned above:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
This error shows up as error roughly every minute and as fatal every time I try to re-add the S3 storage.
I tried changing the Amazon security keys, trying new ones, removing old ones, re-adding etc.. to no avail.
What bothers me is that adding the storage worked perfectly on an owncloud installation on an EC2 instance. To clarify, the instance was an EC2 micro instance, located in the EU region. The S3 storage bucket is a EU bucket as well.
Would it be possible that this error is caused due to different php.ini settings or missing php extensions? Unfortunately I do not have access to the EC2 instance anymore and am thus not able to compare settings at the moment.
@PVince81 @ser72 Do you have an idea?
i have the same issue too,
Fatal - files_external - Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method.
my owncloud version is 6.0.1 (Stable)
how about on version 5?
I have this same issue, running 6.0.1 (stable). I have s3cmd working fine from the command line.
JSON returns valid.
{"data":{"message":false},"status":"success"}
@PVince81 Beta user is having same issue. He is mounting to a "local" S3 rather than actual Amazon's S3.
I was able to mount to Amazon's S3 without issue -- not sure about a "local" S3.
From Beta user:
I'm getting meaningless
ownCloud[2998]: {files_external} Exception:
entries in my logs whenever I change the configuration and there's a red square next to the configuration in the admin panel.
The S3 share works with DragonDisk and s3cmd.
@ser72 what local S3 product are we talking about? Regarding the meaningless Exception: maybe increasing the log level can help?
@DeepDiver1975 Requested information on the local S3 product.
Log levels are increased to maximum already
Beta Tester here. We're using the RADOSGW coming with
ceph version 0.61.4 (1669132fcfc27d0c0b5e5bb93ade59d147e23404)
Hope this helps?
On Fri, Feb 7, 2014 at 2:53 AM, Steve Robinson [email protected]:
@DeepDiver1975 https://github.com/DeepDiver1975 Requested information on the local S3 product.
Log levels are increased to maximum already
— Reply to this email directly or view it on GitHubhttps://github.com/owncloud/core/issues/6724#issuecomment-34434039 .
Be true to your work, your word and your friend. - H.D. Thoreau Never tell a lie when you can bullshit your way through. - E. Ambler, Dirty Story
I have the same problem with both Amazon S3 and Ceph (using radosgw). I believe it's related to the first code bloke referred to by @isdn in the original post. In both cases I get a bucket created, but it fails on the checking and creating of the . directory.
In Ceph I get a 403 error (@ser72 - I got that meaningless exception too until I upgraded to 6.0.2, then I get the 403). And with Amazon S3 I get that error messages that @rvangijlswijk and @rrepolona referred to.
After some debugging I believe the issue is to do with the API stripping the . out. I used Ceph (radosgw) to do this because I can control both ends, unlike with Amazon S3. Here's an example of the header used to calculate the authorization digest:
PUT
1B2M2Y8AsgTpgAmY7PhCfg==
httpd/unix-directory
Thu, 13 Mar 2014 12:25:04 +0000
/owncloud4/
The bucket name is owncloud4, and notice there's no . after it? The digest for the above does not match what's sent in the request. But if I add a . after the last slash, it is.
So this tells me that whatever calculates the digest to put in the header is doing it before the . is stripped out by something further down the line. Looks like a bug in the API? Or maybe you're just not supposed to do this?
In any case, I can't really understand what ownCloud is trying to do in the first place, but hopefully someone with more understanding there can work out the intention behind this code block, and then maybe we can fix it.
I have the very same issue, also with radosgw. I've been able to confirm above theory by basically disabling the above check on line 119: I've replaced '.' by 'dir' on lines 119 and 122 . Now, the object gets created ( as 'dir' ). The check succeeds and I'm presented with a nice green dot instead of a red square. Still the directory doesn't show up under files, however. Hope this helps a bit in finding the culprit.
@RPDiep I tried the same, and although that makes the initial tests pass, it still doesn't work. Something else further down the line is also looking for a . directory. That's probably why it tests for . in the constructor.
@Tim: I did the edit not to fix it, but to prove that the '.' is indeed the problem here. I've copied the 'dir' object to '.' and that still doesn't help any further.
Anyone have a solution? In the log files I'm seeing: Exception: Aws\S3\Exception\RequestTimeTooSkewedException: The difference between the request time and the current time is too large.
@ryannix123 That's probably unrelated to this issue. I suspect your clock is out of sync. Are you using ntp?
You were exactly right. My VM was two hours off. S3 storage is now working as it should.
Thanks, Tim!
Hi all. Just checking to see if anyone has any progress with the "The request signature we calculated does not match the signature you provided. Check your key and signing method." problem.
Running owncloud 6.0.2
Thanks in advance
Exactly the same issue "The request signature we calculated does not match the signature you provided. Check your key and signing method."
If createBucket is allowed and you don't specify a bucket name in configuration, the bucket is well created but after that, the signature error appear.