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 — NPE From some Storage methods · Issue #174 · googleapis/google-cloud-java

NPE From some Storage methods #174

New issue
Copy link
New issue
Copy link
Closed
#183
Closed
NPE From some Storage methods#174
#183
Copy link
Assignees
aozarov
Labels
🚨 criticalP0 critical issue. Requires immediate fixapi: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@simon-temple
simon-temple
opened on Sep 23, 2015
Issue body actions

For example the following calls when listing a bucket that is empty or getting an item from a bucket that exists but the item does not:

    storage.list( bucketName )
    storage.get( bucketName, itemName )

The NPE is generated from the Preconditions class called via transform() in the Iterables class:

public static <T> T checkNotNull(T reference) {
        if(reference == null) {
            throw new NullPointerException();
        } else {
            return reference;
        }
    }

It would be nicer to return a null to the caller perhaps. wdyt?

Activity

Next
  1. mziccard commented on Sep 23, 2015

    @mziccard
    mziccard
    on Sep 23, 2015
    Contributor
    More actions

    Hi @simon-temple, thanks for catching this!
    I was able to reproduce the error with storage.list("non-existing-bucket") while storage.get("existing-bucket", "non-existing-blob") returns null as expected. Could you double check this please?

  2. mziccard commented on Sep 23, 2015

    @mziccard
    mziccard
    on Sep 23, 2015
    Contributor
    More actions

    This problem also occurs when listing buckets if none exists (storage.list()).

  3. mziccard
    self-assigned this
    on Sep 23, 2015
  4. simon-temple commented on Sep 24, 2015

    @simon-temple
    simon-temple
    on Sep 24, 2015
    Author
    More actions

    Here is a stack trace of an attempt to get() a none existent blob from an existing bucket:

    Caused by: java.lang.NullPointerException
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)
        at com.google.gcloud.storage.BlobInfo$Builder.name(BlobInfo.java:125)
        at com.google.gcloud.storage.BlobInfo.builder(BlobInfo.java:390)
        at com.google.gcloud.storage.BlobInfo.of(BlobInfo.java:382)
        at com.google.gcloud.storage.StorageImpl.get(StorageImpl.java:149)
    
  5. simon-temple commented on Sep 24, 2015

    @simon-temple
    simon-temple
    on Sep 24, 2015
    Author
    More actions

    Could you also check:

    bucketInfo = storage.get( "none-existent-bucket" );

    I believe this will also throw a NPE.

  6. mziccard commented on Sep 24, 2015

    @mziccard
    mziccard
    on Sep 24, 2015
    Contributor
    More actions

    Thanks for checking. The stack trace you posted looks more like you are doing something like

    get("existing-bucket", null)
    

    Could you check that the blob name you are passing is actually not null?

  7. simon-temple commented on Sep 24, 2015

    @simon-temple
    simon-temple
    on Sep 24, 2015
    Author
    More actions

    You are correct. My bad...sorry!

    I am calling get("existing-bucket", null) and I shouldn't; but that's my problem :-)

    Thanks for your help.

  8. mziccard commented on Sep 24, 2015

    @mziccard
    mziccard
    on Sep 24, 2015
    Contributor
    More actions

    Nothing to be sorry about. The other problems you spotted when listing an empty bucket or listing buckets when none exists are our fault so let me thank you for catching them :)
    I'll keep this issue open until I fix them (should be real soon).

  9. mziccard
    added
    api: storageIssues related to the Cloud Storage API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 24, 2015
  10. simon-temple commented on Sep 28, 2015

    @simon-temple
    simon-temple
    on Sep 28, 2015
    Author
    More actions

    Thank you for the quick turnaround. Does this project have a SNAPSHOT repo? I'd like to run some tests with the latest/fixed version if possible. Maybe I need to clone the project and rebuild locally?

    Any idea when the next release will be available?

  11. mziccard commented on Sep 28, 2015

    @mziccard
    mziccard
    on Sep 28, 2015
    Contributor
    More actions

    Yes, we are publishing snapshot to Sonatype snapshots repository:

    https://oss.sonatype.org/content/repositories/snapshots/

    Current snapshot is 0.0.8-SNAPSHOT. Be aware that PR #183 is not merged yet so it's not part of the snapshot (i.e. you'll still have this issue). I hope we'll manage to merge it by the end of the day.

    @aozarov should have more info on the plans for next release.

  12. aozarov commented on Sep 28, 2015

    @aozarov
    aozarov
    on Sep 28, 2015
    Contributor
    More actions

    As you can see Storage is still work in progress (and that is why it is not yet mentioned in list of supported services in the README.md).

    Snapshots should be pushed automatically (triggered by Travis), so once this change is pushed it should not take long before it appears here.

  13. aozarov
    closed this as completedin #183on Sep 28, 2015
  14. theacodes
    unassigned
    mziccard
    on Sep 28, 2018
  15. 11 remaining items

  16. github-actions
    added 2 commits that reference this issue on Oct 5, 2022

    chore(main): release 0.6.3-SNAPSHOT (#174)

    5bfea01

    chore(main): release 1.2.7-SNAPSHOT (googleapis#174)

    7801e5b
  17. suztomo
    added a commit that references this issue on Feb 1, 2023

    chore(main): release 2.0.0 (#739)

    ea9f421
  18. meltsufin
    added a commit that references this issue on Dec 22, 2025

    feat!: remove Start/EndTime from LogSink, Metadata from LogEntry, imp…

    d3d2370
  19. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    docs: update README.md (#174)

    7c70aa6

    chore: release 0.118.5 (#226)

    b209ac7
  20. chingor13
    added a commit that references this issue on Jan 22, 2026

    feat(deps): adopt flatten plugin and google-cloud-shared-dependencies (…

    8618c18
  21. chingor13
    added a commit that references this issue on Feb 24, 2026

    Update new token urls (#174)

    1b0f734
  22. suztomo
    added a commit that references this issue on Mar 11, 2026

    feat!: remove Start/EndTime from LogSink, Metadata from LogEntry, imp…

    27dd915
  23. chingor13
    added a commit that references this issue on Mar 12, 2026

    Update new token urls (#174)

    1c726e9
  24. suztomo
    added a commit that references this issue on Mar 23, 2026

    fix: return empty catalog name (googleapis#174)

    e2bf4d2
  25. suztomo
    added a commit that references this issue on Mar 30, 2026

    fix: Set storage update time in FakeStorageRpc (#174)

    d3b449a
  26. lqiu96
    added a commit that references this issue on Apr 1, 2026

    fix: Set storage update time in FakeStorageRpc (#174)

    98fbaa6
  27. blakeli0
    added a commit that references this issue on May 18, 2026

    feat: Affinity keys cleanup. Allow setting keys lifetime (#174)

    0b940e7
  28. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore: release 1.10.1-SNAPSHOT (googleapis#174)

    dbf28c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @aozarov
    aozarov

Labels

🚨 criticalP0 critical issue. Requires immediate fixapi: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.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.