craftcms / google-cloud

Google Cloud Storage volume type for Craft CMS.
https://plugins.craftcms.com/google-cloud
MIT License
11 stars 10 forks source link

Cannot insert legacy ACL for an object when uniform bucket-level access is enabled #23

Closed ebarcsay closed 3 years ago

ebarcsay commented 3 years ago

Description

If the bucket Access control setting is set to uniform in Google Cloud Storage Bucket Settings, I got the following error message from GCP while trying to upload an image: "Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access"

Screenshot 2021-07-02 at 15 00 07

Steps to reproduce

  1. Create a new volume under Settings > Assets > Volumes
  2. Set Volume Type to Google Cloud Storage and set other options and select the appropriate bucket.
  3. Create a new 'asset' type field and select the newly created volume.
  4. Add the new field to a section.
  5. Try to create a new entry and upload a file to the field.
  6. You'll get the error message above.

Additional info

Cloud Storage Access control settings:

Screenshot 2021-07-02 at 15 56 17
andris-sevcenko commented 3 years ago

This is not something that Craft can influence easily.

Both the Google Cloud adapter we use for Craft 3.x (superbalist/flysystem-google-storage) and the one we will be using for Craft 4.x (league/flysystem-google-cloud-storage) set the ACL value explicitly and there's not much we can do about it short of writing our own adapter.

That setting simply conflicts with how both of those adapters work..