We have a project which has been on hold for over a year. It used to do Video/Zencoder/Amazon S3 just fine. Returning to the project now and i get this error:
Warning: filesize(): stat failed for s3://videos/original/heart.mov in file_save() (line 614 of /home/cheereos/public_html/eos/includes/file.inc).
I have upgraded to the following:
core: 7.59
video: 7.x-2.13
file entity: 7.x-2.21
AmazonS3: 7.x-1.1
AWS SDK for PHP: 7.x-5.4 (this was originally there).
Libraries:
AWS SDK - 1.6.2 (I think)
Zencoder 2.0.2
.. and error is the same.
Looking at Amazon S3 project page i see requirements:
- need Composer Manager but do not have it and never did have it (and worked fine for years without it - is it needed now?)
- patches: have done no patches as i am not storing images (this is for videos) and not using different buckets for different fields - i do run a multisite which uses different buckets per sites; but dont think a patch is required for this.
I find it odd that error msg shows s3://videos/original/heart.mov and my bucket name is not included in there; but even though this is mentioned in many places; perhaps the filesize function simply is reporting error incorrectly?
I haven't been able to find any current documentation saying how to set this all up so have been just reviewing the numerous issue posts which seem related - none of which seem to have any impact.
Perhaps this is a Support Request rather than a bug, so maybe my simple questions are just:
1. is there a guide saying what versions/branches of various modules are required?
2. is there any documentation showing complete setup for this?
I believe you can fix this by changing your S3 Bucket policy. Here's an example:
"Version": "2012-10-17", "Id": "ZencoderBucketPolicy", "Statement": [ "Sid": "Stmt1295042087538", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::395540211253:root" "Action": [ "s3:GetObjectAcl", "s3:GetObject", "s3:PutObjectAcl", "s3:PutObject", "s3:ListMultipartUploadParts" "Resource": "arn:aws:s3:::YOURBUCKET/*" "Sid": "Stmt1295042087538", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::395540211253:root" "Action": [ "s3:ListBucketMultipartUploads", "s3:GetBucketLocation" "Resource": "arn:aws:s3:::YOURBUCKET"Just to confirm that with the above aws configuration the error goes away. It's not a great configuration to have though.
Comment #5
bburgWhat specifically about the configuration in #3 fixes the error? I am running into this myself, which also seems to be accompanied by this permissions error from the AWS SDK:
User warning: 403 Forbidden (Request-ID: XXXXXXXXXXXXXXXX) in Aws\S3\StreamWrapper->triggerError() (line 822 of /composer-manager/vendor/aws/aws-sdk-php/src/Aws/S3/StreamWrapper.php).
The referenced line in the SDK is a generic error handler, so I'm not sure what's causing it.