Closed Jacotheron closed 2 years ago
For anyone else, having this issue, I have resolved it by allowing the ACL as well as setting the following values in the config/filesystems.php, for the s3 driver:
'visibility' => 'private',
'directory_visibility' => 'private',
After many hours I was able to follow the configuration settings to find that this will be inserted at the critical point, allowing requests to succeed.
I am trying to setup an S3 environment which is handled by CloudFront (while at this time, not using it for videos; it makes sense to also store images and documents for the website in this way). I set everything up with the tutorial at https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-cloudfront-route53-video-streaming.html.
This setup requests the following:
In debugging this, I have changed the Object Ownership to allow ACL, but still I get errors (this time only permission denied)
Now, when I try to use the File Manager, I get errors (specifically the "AccessControlListNotSupported" error, details at https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-ownership-error-responses.html). The errors occur while attempting to create a folder. In short, due to using policies
After a lot of debugging, and learning how the different parts of the Laravel filesystem api works, I have narrowed it down to the following section: "LfmStorageRepository" line 51. The 2nd parameter being passed (
func_get_args
), but is not received by 'Illuminate/FilesystemAdapter' (line 794), as it only takes a single argument. When it forwards it to the driver "Flysystem/AWSS3V3Adapter" (line 268) - it generates a complete empty config, which then tries to set the folder to private, which triggers the eror (as it can only have full control for bucket owner, or no ACL).Any suggestions to solve this issue?
As an extra note, I also make use of Spatie Media Library, which handles the create/read/delete of the files and folders on the S3 with no issue (it seems they plug in very early into the Filesystem api, and let Laravel handle everything).