Skip to content
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

Uploads to Bucket with Uniform access control silently fails #521

Open
vojkny opened this issue Aug 5, 2020 · 5 comments
Open

Uploads to Bucket with Uniform access control silently fails #521

vojkny opened this issue Aug 5, 2020 · 5 comments

Comments

@vojkny
Copy link

vojkny commented Aug 5, 2020

Error description:

When bucket has "Uniform access control" set instead of "Fine grained", any uploads to this bucket will silently fail and everything will seem to be fine. However there will be nothing uploaded and the image will stay in the wp-content folder.

Unwanted result:

The person who uploads the image seems to think that the upload was succesful and even sees the uploaded image. Once the kubernetes pod is restarted, the image will obviously disappear.

Expected result:

If bucket has uniform access control set, any upload should fail with explanatory message.

@alimuzzaman alimuzzaman self-assigned this Aug 5, 2020
@cdp1337
Copy link

cdp1337 commented Aug 20, 2020

..... WHAT THE SH...... well thank you kind sir, you may have saved me hours of debugging and troubleshooting. It kept listing that the uploads were successful, but the bucket was mysteriously empty, I thought I was going crazy.

@wingho-chung
Copy link

thank you, you saved my day

@Eeemil
Copy link

Eeemil commented Apr 15, 2021

Thank you, but my day was not saved. I spent my day troubleshooting this silent error and I came here to report this issue. :)

But other peoples days can still be saved, the line that fails is this: https://github.com/udx/wp-stateless/blob/v3.0/lib/classes/class-gs-client.php#L253 , the exception is thrown but is not handled correctly. The exception says

wpCloud\StatelessMedia\Google_Client\Google_Service_Exception: {
  "error": {
    "code": 400,
    "message": "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",
    "errors": [
      {
        "message": "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",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

@zackexplosion
Copy link

Finally found this, same here!

@vojkny
Copy link
Author

vojkny commented Jun 22, 2022

@vsychov I can see you merged some changes related to this – is this fixed? Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants