Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple S3 configurations w/same access keys #7543

Closed
colinc opened this issue Mar 4, 2014 · 9 comments
Closed

Multiple S3 configurations w/same access keys #7543

colinc opened this issue Mar 4, 2014 · 9 comments

Comments

@colinc
Copy link

colinc commented Mar 4, 2014

Steps to reproduce

  1. Admin > External Storage
  2. Add an Amazon S3 configuration
  3. Add another Amazon S3 configuration with the same keys but a different bucket
  4. Browse to the first bucket
  5. Browse to the second bucket

Expected behavior

The second bucket should list the items in the second S3 bucket

Actual behavior

The second bucket lists the items in the first S3 bucket and throws 404 Not Found errors in the log.

The exception is being caught here:
https://github.com/owncloud/core/blob/master/apps/files_external/lib/amazons3.php#L278

Server configuration

ownCloud version: 6.0.2 (happened on previous 6.x releases)

Code

It looks like this is a result of a non-unique ID in the AmazonS3 __construct function.

https://github.com/owncloud/core/blob/master/apps/files_external/lib/amazons3.php#L81

Using the same IAM account with unique access keys resolves the problem.

@karlitschek karlitschek added the Bug label Mar 5, 2014
@karlitschek
Copy link
Contributor

@PVince81 What do you think?

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2014

@colinc do you want to have a try fixing it and send a PR ?
I guess the md5 of the bucket name could possibly be added into the id ? (I don't have a S3 instance so can't test)

@colinc
Copy link
Author

colinc commented Mar 5, 2014

@PVince81 No problem. Do I need to fill out the contributor agreement first? I wasn't sure if this was considered "a module" (since it's in the app directory) or part of core (since it's in the core repo).

@PVince81
Copy link
Contributor

PVince81 commented Mar 5, 2014

@colinc no worries.

You can either:

  1. Fill the contributor agreement now and get push access to the core repo, then make a PR from a branch in the core repo

or

  1. Make the PR from your own fork, submit a PR to the core repo and then state that your patch is MIT licensed (or fill out the contributor aggrement at that time)

@PVince81
Copy link
Contributor

@colinc did you manage to make it work ?

@tomasbulva
Copy link

I'm experiencing the same issue. Did anyone figured out what's wrong?

@nocarryr
Copy link

Please excuse my unfamiliarity with collaboration here. I created a pull request after discovering what was causing this issue here:

#10035

I may have done that prematurely and commented here instead. If the "id" of the storage object includes the "bucket", then multiple buckets can be used and their objects will have unique identifiers.

Since all Amazon S3 buckets (across their entire system) must have unique names, the credentials themselves are actually unnecessary (unless I'm missing something).

I'm not sure how this would affect things in terms of database migrations and backwards compatibility though since I'm not a PHP developer.

@DeepDiver1975
Copy link
Member

Secondary s3 storage integration just got move over to https://github.com/owncloud/files_external_s3.

Unfortunately GitHub does not allow to move issues. Please reopen the issue at https://github.com/owncloud/files_external_s3/issues

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants