-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
- Search the issues already opened: https://github.com/googleapis/java-storage/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform
If you are still having issues, please include as much information as possible:
Environment details
- Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types - OS type and version:
- Java version: 1.8.x
- storage version(s): 1.113.9
Steps to reproduce
Code example
// exampleStack trace
c.g.c.s.StorageException: Not sure what occurred. Here's debugging information:
Response:
com.google.api.client.http.HttpResponseException: 503 Service Unavailable
PUT https://storage.googleapis.com/upload/storage/v1/b/.../o?name=...&uploadType=resumable&upload_id=...
at c.g.c.s.s.v.HttpStorageRpc.getCurrentUploadOffset(HttpStorageRpc.java:790) ~[google-cloud-storage-1.113.9.jar:1.113.9]
at c.g.c.s.BlobWriteChannel$1.run(BlobWriteChannel.java:133)
at j.u.c.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_181]
at c.g.a.g.r.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105) ~[gax-1.60.1.jar:1.60.1]
at c.g.c.RetryHelper.run(RetryHelper.java:76) ~[google-cloud-core-1.94.0.jar:1.94.0]
at c.g.c.RetryHelper.runWithRetries(RetryHelper.java:50)
at c.g.c.s.BlobWriteChannel.flushBuffer(BlobWriteChannel.java:70) ~[google-cloud-storage-1.113.9.jar:1.113.9]
at c.g.c.BaseWriteChannel.close(BaseWriteChannel.java:151) ~[google-cloud-core-1.94.0.jar:1.94.0]
at j.n.c.Channels$1.close(Channels.java:178) ~[na:1.8.0_181]
External references such as API reference guides
Any additional information below
I am using https://github.com/googleapis/java-storage/blob/v1.113.9/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java#L2673 to stream uploads.
Occasionally 503 response code is returned when executing https://github.com/googleapis/java-storage/blob/v1.113.9/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java#L752 and 0 is used as the error code when throwing a StorageException. If I understand correctly the error code is used to determine when to retry and 0 is not part of the retry-able error codes (https://github.com/googleapis/java-storage/blob/v1.113.9/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java#L40), but in this case we should retry 503s.