-
Notifications
You must be signed in to change notification settings - Fork 106
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
upload fails with uniform access controls #108
Comments
Maybe this could be solved like this: https://github.com/googleapis/google-cloud-php/pull/2541/files |
I believe the problem is that change in google-cloud-php means flysystem-google-cloud-storage/src/GoogleStorageAdapter.php Lines 143 to 149 in f3ec295
|
I've gone down the path of manually updating what I needed to get this done: I assume others of you are doing the same given this has been an issue for so long. |
The problem is that upload fails if $options['predefinedAcl'] is set and this option is set by default on every upload
GoogleStorageAdapter line 139: protected function getOptionsFromConfig(Config $config)
error message:
"code": 400,
"message": "Cannot use ACL API to set object policy when object policies are disabled."
I don't see a clear cut path to fix this because the bucket cannot be queried for the acl type
$bucket->acl()->get() will fail with a 400 as well on a bucket with uniform access controls
The path forward is either open a bug with at https://github.com/googleapis/google-cloud-php-storage to make the type property somehow accessible.
Another option would be to catch BadRequestHttpException on $bucket->upload and try again with the acl removed. I would consider this inefficient because every request will have to be sent at least twice.
Maybe there are other options and I overlooked something.
The text was updated successfully, but these errors were encountered: