Hi there,
I've just installed this module, and tried to use it with Amazon S3.
So I created a bucket, added a new user, and set it up his credentials:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ModifyAssets",
"Action": [
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:GetObjectVersionAcl",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::mybucketname/*"
]
},
{
"Sid": "BucketRights",
"Action": [
"s3:ListBucket",
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
}
]
}
When I try to create a new file storage, I get this error: The bucket name field gets a red border, and that's it. No message, no nothing.
The bucket name is correct, and so ar the user credentials, I've checked them several times.
I've tried with both versions (the stable and the dev). Both it's the same.
UPDATE:
I've thought that maybe the problem could be related with Amazon S3 permission policy. So I've changed it to this, in order to test it out:
This is the default "Power User Access" policy. The result is the same.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"NotAction": "iam:*",
"Resource": "*"
}
]
}
Comments
Comment #1
Rosamunda CreditAttribution: Rosamunda commentedComment #2
Perignon CreditAttribution: Perignon commentedCouple things. I've seen that happen on the bucket name even for myself. The form error isn't printing anything around the box for some reason even though there is error messages coded. Also check your logs too because a log entry is also made when this happens.
Now to check that you have the S3 module setup correctly. Create a bucking using Drupal and not the AWS Console. If everything works correctly then you know you have your credentials setup correctly. I need to update the S3 form to say that you do not have to create the bucking in the AWS console first, this module will create the bucket for you.
Your first bucket policy looks ok, you just have to make sure that the account your access and secret keys are coming is part of that policy.
Personally what I did was create an identity specifically for the Drupal module. That way I have it "jailed" in a way.
Comment #3
Perignon CreditAttribution: Perignon commentedIF you could dig the error out of your log that would help me a lot. I'm trying to trace down where the drupal set form error is failing to set a message.
Comment #5
Rosamunda CreditAttribution: Rosamunda commentedHi again,
Thanks for replying!
I haven't checked creating a bucket using the module, I'll try that out, but first, I'll post here the logs:
Referrer: .../admin/structure/storage/create-container
Referrer: .../admin/structure/storage/create-container
Comment #6
Rosamunda CreditAttribution: Rosamunda commentedI've just tried creating a new bucket and I get the same screen and error type:
Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in StorageS3->request() (line 126 of /home/sitio/public_html/sites/all/modules/storage_api/services/s3.inc).
It seems that has something to do with my php settings?
Again, thanks for caring about this.
Rosamunda
Comment #7
Perignon CreditAttribution: Perignon commentedYeah this is due to a PHP setting. I am going to assume you are on a shared host wher you have no control over the PHP settings?
Either safe_mode or open_basedir is set which will not allow cURL to perform redirections. Well documented here:
http://php.net/manual/en/function.curl-setopt.php#102121
Comment #8
Rosamunda CreditAttribution: Rosamunda commentedOh I see. Is there any workaround to solve this?
Comment #9
Perignon CreditAttribution: Perignon commented@Rosamunda At the moment there is no work around for this unless your host allows you to override PHP settings via your .htacess file.
I will look into it as I am starting a major update of the S3 service provider to catch up to AWS's new signing method for requests (V4)
Comment #10
Perignon CreditAttribution: Perignon commentedAdding tags for searching
Comment #11
Perignon CreditAttribution: Perignon commentedComment #12
Rosamunda CreditAttribution: Rosamunda commentedI can override php using .htaccess. What should I do in that case?
Thanks again!!
Comment #13
Perignon CreditAttribution: Perignon commentedTurn off safe_mode and unset the open_basedir
Comment #14
Rosamunda CreditAttribution: Rosamunda commentedIt worked!
(I've to talk with my host though).
I'm changing the type of issue, because it does work, but It just need to be configured in a certain way...
THANKS!! :)
Comment #15
Perignon CreditAttribution: Perignon commentedNo worries!
Comment #17
Perignon CreditAttribution: Perignon commentedComment #18
synergy99 CreditAttribution: synergy99 commentedHi, we've run into the same issue, again when configuring a container. However in our case, open_basedir and safe_mode aren't set.
Can you give us any other leads as to what might be causing this?
Comment #19
Perignon CreditAttribution: Perignon commentedFirst, what is in your logs when this happens. Both Drupal and PHP.
Comment #20
synergy99 CreditAttribution: synergy99 commentedThanks for the response Perignon, please excuse me for wasting your time. The client was using cpanel & we tracked it down to the 'open_basedir tweak' that overrides php.ini.
Comment #21
Perignon CreditAttribution: Perignon commentedOk sounds good!