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

Retry on Google upload 503 #702

Closed
Natim opened this issue May 15, 2019 · 4 comments
Closed

Retry on Google upload 503 #702

Natim opened this issue May 15, 2019 · 4 comments
Labels

Comments

@Natim
Copy link

Natim commented May 15, 2019

Lately we started to get a lot of 503 on Google Storage.
The model.save() method raises and creates a 500 on our end.
Is there a way to retry a couple of time in case the storage api raises a 503?

File "/usr/local/lib/python3.7/site-packages/storages/backends/gcloud.py", line 180, in _save
    file.blob.acl.save_predefined(self.default_acl)
File "/usr/local/lib/python3.7/site-packages/google/cloud/_http.py", line 319, in api_request
    raise exceptions.from_http_response(response)
google.api_core.exceptions.ServiceUnavailable: 503 GET https://www.googleapis.com/storage/v1/b/bucket-id/o/uploads%2F74db120f-0a8e-5646-ef5a-30154e9f6deb_O15V4hn.jpg/acl: Backend Error
@sww314 sww314 added the google label May 15, 2019
@sww314
Copy link
Contributor

sww314 commented May 15, 2019

There is nothing now. I am not sure the storages layer is where you want to add a retry capability because it would block everywhere Django uses a file operation.

I think the 503s are caused by setting the ACL right after the image upload.
This is fixed by #698, but it is not released yet.
You can try it by installing master.

@Natim
Copy link
Author

Natim commented May 15, 2019

I think the 503s are caused by setting the ACL right after the image upload.
This is fixed by #698, but it is not released yet.
You can try it by installing master.

Thank you for your answer, I am going to try this thanks.

@Natim
Copy link
Author

Natim commented May 15, 2019

I am closing for now and will reopen if I reach this issue again.

@Natim Natim closed this as completed May 15, 2019
@Natim
Copy link
Author

Natim commented May 16, 2019

After almost a day in production no 503 anymore. I would be glad to have it tagged and released if someone has the mandatory permissions?

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

Successfully merging a pull request may close this issue.

2 participants