Repository navigation
Conversation
For some reason the aws-sdk-php package does not caclulate the signiture correctly when accessing an object in a bucket with a name of '.'. When we are at the top of a S3 bucket there is a need(?) to have a directory name. Per standard Unix the name picked was '.' (dot or period). This choice exercises the aws-sdk bug. This fix is to add a field to the method to store the name to use instead of '.' which at this point is hard coded to '<root>'. We also add a private function 'cleanKey()' which will test for the '.' name and replace it with the variable. Finally all calls to manipulate objects where the path is not obviously not '.' are processed through cleanKey(). An example where we don't process through clean key would be 'Key' => $path.'/',
|
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/ Alternatively you can add a comment here where you state that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
|
This fix is contributed to owncloud under the MIT license agreement. |
There was a problem hiding this comment.
Per feed back use === instead of ==
|
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/ Alternatively you can add a comment here where you state that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
|
@owncloud-bot this is ok to test |
|
The inspection completed: 39 new issues, 37 updated code elements |
|
@PVince81 Do you know somebody who can test with Amazon S3? cc @DeepDiver1975 |
|
I encountered the signature match error described here when setting up a new install of ownCloud 6.0.2 stable. I applied the changes in this pull request and got a green S3 connection. I'm seeing correct results when browsing my files now. |
|
@GloryFish Thanks for testing. @karlitschek Can we see this as a 👍 ? |
|
@owncloud-bot retest this please |
|
🚀 Test Passed. 🚀 |
|
#8325 is likely the same underlying error in the SDK. AWS-SDK-PHP is looking at the issue and I expect they will fix it. In the mean time the files_external/amazons3.php has a method that can be used for cleaning any request. I think we can change umlauts (and other such characters) to a UTF-8 encoding which is likely to fix the issue. The problem with this fix is that if you upload an object with umlauts via the S3 interface (or other tool) and then access it via owncloud it is unlikely you will be able to make a round trip. I'll also check to see if umlauts are allowed in AWS S3 Object names. |
|
@ser72 can you help testing this ? Thanks. |
|
@PVince81 Sure -- what are the reproduction steps? What am I looking for? :) |
|
@PVince81 @ser72 To replicate the issue:
The indicator will go to red circle. At this point you can look at the logs and see the signature error. Apply the PR. Restart the service. Go to admin page and the S3 storage should show green. Complete testing by creating directories and files at the top level and lower levels. |
|
I see from my commit comment and the comments here that there is a bit of confusion regarding the bug. This bug exists when an OBJECT with a name of |
|
I've done S3 storage on 6.0.2 and haven't seen the above issue. I've always gotten the green light and not a red light as you mention.? So I don't think I will be able to reproduce this issue. |
|
@ser72 Can you try again? If you do not see the error then there is an underlying
|
There was a problem hiding this comment.
I'm not familiar with S3, so asking: is this string <root> a convention of the S3 API to tell that you want the root or is it just a name you're using as workaround because . doesn't always work ?
There was a problem hiding this comment.
Vincent, at issue is a bug in the aws-sdk for s3 that does not handle
files with a name of '.' correctly. It also looks like they do not handle
characters that have things like umlaut's in them. This variable "$root"
is used to hold the name of the root directory. I.e. if the code
references the "." directory then we will change it to "".
The side affect of this fix is that it is no longer possible to have a file
name of "".
On Fri, Jun 20, 2014 at 3:55 AM, Vincent Petry [email protected]
wrote:
In apps/files_external/lib/amazons3.php:
@@ -53,6 +53,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
* @var int
*/
private $timeout = 15;
- private $root = '';
@ctjctj https://github.com/ctjctj please clarify
—
Reply to this email directly or view it on GitHub
https://github.com/owncloud/core/pull/8195/files#r14009923.
|
@cdamken can you test this ? With a bit of luck it might also solve the issues you mentioned to me recently. |
|
I tried this but still got: {"reqId":"53b194e69bad5","app":"files_external","message":"Aws\\S3\\Exception\\NotImplementedException: A header you provided implies functionality that is not implemented","level":4,"time":"2014-06-30T16:48:38+00:00","method":"POST","url":"\/core\/index.php\/apps\/files_external\/ajax\/addMountPoint.php"}I changed |
|
@ctjctj I changed |
|
@cdamken could you test this PR and change |
|
@butonic works both ways: |
|
@butonic Can you take care of the merge and backport? |
|
@cdamken yeah, but with |
|
superseded by #9509 |

For some reason the
aws-sdk-phppackage does not calculate thesignature correctly when accessing an object in a bucket with a name of
..When we are at the top of a S3 bucket there is a need(?) to have a directory
name. Per standard Unix the name picked was '.' (dot or period). This
choice exercises the aws-sdk bug.
This fix is to add a field to the method to store the name to use instead of
'.' which at this point is hard coded to ''. We also add a private
function
cleanKey()which will test for the '.' name and replace it withthe variable. Finally all calls to manipulate objects where the path is
not obviously not '.' are processed through
cleanKey().An example where we don't process through clean key would be