GeezerVison is showing github.com — Storage: `BlobWriteChannel` generates `NullPointerException` in some failure cases (e.g. networking issues) · Issue #839 · googleapis/java-storage
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Storage: BlobWriteChannel generates NullPointerException in some failure cases (e.g. networking issues) #839Labels api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionProblem
BlobWriteChannel generates NullPointerException in some failure cases (e.g. due to a networking error).
Specifically, BlobWriteChannel:176 might retrieve null StorageObject which causes BlobWriteChannel:180 to generate NullPointerException when trying to dereference it.
This unhandled exception makes it difficult to clearly resolve issues and resume any impacted operations/scripts. As an engineer/on call, I want logs to be more clear (unnecessary exceptions not to be thrown at all if that's possible), so I can get issues resolved faster with less confusion and spend less time on manual workarounds.
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:
- storage version(s): 1.113.14 and 1.114.0.
Steps to reproduce
- Simulate faulty network (dropped packets ~35%, less works too, but takes more time to catch)
- Call
BlobWriteChannel
- See
NullPointerException
Stack trace
java.lang.RuntimeException: java.util.concurrent.ExecutionException: ... omitted ...
Caused by: ...: Unable to write ...
... omitted ...
Caused by: java.lang.RuntimeException: Unable to write ... to gs://...
... omitted ...
... 10 more
Caused by: com.google.cloud.storage.StorageException: java.lang.NullPointerException
at com.google.cloud.storage.StorageException.translateAndThrow(StorageException.java:81)
at com.google.cloud.storage.BlobWriteChannel.flushBuffer(BlobWriteChannel.java:212)
at com.google.cloud.BaseWriteChannel.close(BaseWriteChannel.java:151)
at java.base/java.nio.channels.Channels$1.close(Channels.java:177)
at java.base/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
at java.base/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
at org.apache.avro.file.DataFileWriter.close(DataFileWriter.java:461)
... omitted ...
... 14 more
Caused by: java.lang.NullPointerException
at com.google.cloud.storage.BlobWriteChannel$1.run(BlobWriteChannel.java:180)
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:157)
Activityadded priority: p2Moderately-important priority. Fix may not be included in next release. type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on May 20, 2021added a commit that references this issue on Jun 1, 2021This issue will close once commit d0f2184 is merged into the 'main' branch.d0f2184 frankyn commented on Jun 1, 2021 This is not yet resolved, IIUC, and the change merged is to provide more debugging context. @BenWhitehead is this accurate? BenWhitehead commented on Aug 6, 2021 Received confirmation from the customer they're no longer seeing the error after upgrading to the latest version. added a commit that references this issue on Sep 28, 2021This issue will close once commit 447d35d is merged into the 'main' branch.447d35d
MetadataMetadataapi: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|