You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
StorageException: Resumable upload is already complete. #666
java.lang.NullPointerException: null
at com.google.cloud.storage.spi.v1.HttpStorageRpc.getCurrentUploadOffset(HttpStorageRpc.java:783)
at com.google.cloud.storage.BlobWriteChannel$1.run(BlobWriteChannel.java:125)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
at com.google.cloud.storage.BlobWriteChannel.flushBuffer(BlobWriteChannel.java:70)
at com.google.cloud.BaseWriteChannel.close(BaseWriteChannel.java:151)
at com.google.cloud.storage.StorageImpl.createFrom(StorageImpl.java:265)
...snip...
This appeared in 1.113.4 but no longer appears in 1.113.6. Thanks for the fix.
Instead (in 1.113.6) we now sometimes see:
com.google.cloud.storage.StorageException: Resumable upload is already complete.
at com.google.cloud.storage.spi.v1.HttpStorageRpc.getCurrentUploadOffset(HttpStorageRpc.java:769)
at com.google.cloud.storage.BlobWriteChannel$1.run(BlobWriteChannel.java:125)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
at com.google.cloud.storage.BlobWriteChannel.flushBuffer(BlobWriteChannel.java:70)
at com.google.cloud.BaseWriteChannel.close(BaseWriteChannel.java:151)
at com.google.cloud.storage.StorageImpl.createFrom(StorageImpl.java:265)
...snip...
I don't have a self-contained reproducer; this seems quite intermittent. Generally we just call com.google.cloud.storage.Storage#createFrom(com.google.cloud.storage.BlobInfo, java.io.InputStream, int, com.google.cloud.storage.Storage.BlobWriteOption...) with content in the range of 100 bytes to a few MiB in length. I added retry logic to my own code, which repeats this call unmodified and without delay (with a fresh java.io.InputStream having the exact same content); this always seems to succeed on the second try. We always use BlobWriteOption#disableGzipContent and sometimes use BlobWriteOption#encryptionKey(java.security.Key). The only instances I have seen have all occurred while CSEK was in use, but that doesn't necessarily prove it doesn't also happen without CSEK.
I can try to write a reproducer but it would basically consist of uploading random objects using this API in a tight loop until (hopefully) encountering the same issue.
Activity
frankyn commentedon Dec 16, 2020
Hi @n12c!
Thanks for filing the issue. Do you have an example use case that causes this issue?
n12c commentedon Dec 16, 2020
I don't have a self-contained reproducer; this seems quite intermittent. Generally we just call
com.google.cloud.storage.Storage#createFrom(com.google.cloud.storage.BlobInfo, java.io.InputStream, int, com.google.cloud.storage.Storage.BlobWriteOption...)with content in the range of 100 bytes to a few MiB in length. I added retry logic to my own code, which repeats this call unmodified and without delay (with a freshjava.io.InputStreamhaving the exact same content); this always seems to succeed on the second try. We always useBlobWriteOption#disableGzipContentand sometimes useBlobWriteOption#encryptionKey(java.security.Key). The only instances I have seen have all occurred while CSEK was in use, but that doesn't necessarily prove it doesn't also happen without CSEK.I can try to write a reproducer but it would basically consist of uploading random objects using this API in a tight loop until (hopefully) encountering the same issue.
frankyn commentedon Dec 16, 2020
Thanks! I'll try to reproduce the issue, it might be a retry an accidental retry when there shouldn't be one.
n12c commentedon Dec 16, 2020
Update: I just saw this happen without CSEK (no encryption of any kind, just the default Google managed keys). So, CSEK is not a factor.
richiesgr commentedon Jan 3, 2021
Hi
Any update regarding what cause this ?
frankyn commentedon Jan 11, 2021
Hi @richiesgr I'm working to release a fix today. Apologies for the delay.
fix: last chunk is retriable (#677)