Repository navigation
Description
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.
Activity
isdn commentedon Jan 11, 2014
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.
PVince81 commentedon Jan 12, 2014
@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.
isdn commentedon Jan 12, 2014
@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).
rvangijlswijk commentedon Jan 26, 2014
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:
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.
karlitschek commentedon Jan 26, 2014
@PVince81 @ser72 Do you have an idea?
rrepolona commentedon Jan 30, 2014
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?
jstenquist commentedon Jan 30, 2014
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"}
ser72 commentedon Feb 7, 2014
@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.
DeepDiver1975 commentedon Feb 7, 2014
@ser72 what local S3 product are we talking about? Regarding the meaningless Exception: maybe increasing the log level can help?
ser72 commentedon Feb 7, 2014
@DeepDiver1975 Requested information on the local S3 product.
Log levels are increased to maximum already
sfabel commentedon Feb 10, 2014
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]:
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
tdb commentedon Mar 13, 2014
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: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.
RPDiep commentedon Mar 16, 2014
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.
tdb commentedon Mar 16, 2014
@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.RPDiep commentedon Mar 16, 2014
@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.
8 remaining items
sfabel commentedon Jun 19, 2014
This is really annoying and stopping our rollout of 6.0.3. @karlitschek @ser72
PVince81 commentedon Jun 20, 2014
There seems to be a PR for that already #8195
Could you guys try out that patch ?
craigpg commentedon Jun 26, 2014
Keeping in oC 7.0 CE
sfabel commentedon Jun 30, 2014
@PVince81 - thanks, we will try. Lots of stuff going on and several bugs with OC6 that need to be addressed at our end here. Is this patch in 6.0.4 already because we've upgraded to that version Friday.
PVince81 commentedon Jul 1, 2014
That patch/PR is not merged yet, which means it hasn't been released yet.
Still needs testing.
butonic commentedon Jul 4, 2014
I successfully reproduced and fixed this issue by changing
<root>to/in PR #8195. Testers needed!DeepDiver1975 commentedon Jul 8, 2014
fixed by #9509 for oc7
DeepDiver1975 commentedon Jul 8, 2014
will be fixed with oc7 and oc6.0.5
PVince81 commentedon Jul 10, 2014
I'd like to ask whoever tried with the old version of the patch to try again with the new version in #9509, because the approach was slightly modified.
Instead of using "" it now uses "/" as root.
Please try again with that PR.
Or you can try with the stable7 branch where the patch is on.
Thanks.