GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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) #839

Copy link
Copy link
Closed
#846
Closed
Storage: BlobWriteChannel generates NullPointerException in some failure cases (e.g. networking issues)#839
#846
Copy link
Assignees
BenWhitehead
Labels
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.

Description

@AdamBSteele
AdamBSteele
opened on May 19, 2021
Issue body actions

Problem

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

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version:
  3. Java version:
  4. storage version(s): 1.113.14 and 1.114.0.

Steps to reproduce

  1. Simulate faulty network (dropped packets ~35%, less works too, but takes more time to catch)
  2. Call BlobWriteChannel
  3. 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)
Reacted by Igor Perikov

Activity

  1. product-auto-label
    added
    api: storageIssues related to the googleapis/java-storage API.
    on May 19, 2021
  2. BenWhitehead
    added
    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.
    on May 20, 2021
  3. BenWhitehead
    self-assigned this
    on Jun 1, 2021
  4. BenWhitehead
    closed this as completedin #846on Jun 1, 2021
  5. BenWhitehead
    added a commit that references this issue on Jun 1, 2021

    fix: improve error detection and reporting for BlobWriteChannel retry…

    This issue will close once commit d0f2184 is merged into the 'main' branch.
    d0f2184
  6. frankyn
    reopened this on Jun 1, 2021
  7. frankyn commented on Jun 1, 2021

    @frankyn
    frankyn
    on Jun 1, 2021
    Contributor
    More actions

    This is not yet resolved, IIUC, and the change merged is to provide more debugging context. @BenWhitehead is this accurate?

  8. gcf-merge-on-green
    added a commit that references this issue on Jun 1, 2021

    chore: release 1.115.0 (#834)

    0018bcb
  9. BenWhitehead
    added a commit that references this issue on Jul 13, 2021

    fix: correct lastChunk retry logic in BlobWriteChannel (#918)

    ab0228c
  10. BenWhitehead commented on Aug 6, 2021

    @BenWhitehead
    BenWhitehead
    on Aug 6, 2021
    Collaborator
    More actions

    Received confirmation from the customer they're no longer seeing the error after upgrading to the latest version.

  11. BenWhitehead
    closed this as completedon Aug 6, 2021
  12. BenWhitehead
    added a commit that references this issue on Sep 28, 2021

    fix(1.113.14-sp): backport critical bug fixes (#993)

    This issue will close once commit 447d35d is merged into the 'main' branch.
    447d35d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @BenWhitehead
    BenWhitehead

Labels

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.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.