sonatype-nexus-community / nexus-blobstore-google-cloud

Nexus Repository Manager Blobstore backed by Google Cloud Storage
https://help.sonatype.com/en/configuring-blob-stores.html#google-cloud-blob-store
Eclipse Public License 1.0
39 stars 16 forks source link

'java.lang.NullPointerException: Required parameter project must be s… #18

Closed sharkannon closed 6 years ago

sharkannon commented 6 years ago

…pecified.' when trying to create a google blobstore, based on https://stackoverflow.com/questions/46308973/project-parameter-not-found-when-creating-google-cloud-bucket-java-api it appears that projectid needs to be set independant of credentials.

(brief, plain english overview of your changes here)

This pull request makes the following changes:

(If there are changes to the UI, please include a screenshot so we know what to look for!)

(If there are changes to user behavior in general, please make sure to update the docs, as well)

It relates to the following issue #s:

sonatypecla[bot] commented 6 years ago

Thanks for the contribution! Before we can merge this, we need @sharkannon to sign the Sonatype Contributor License Agreement.

nblair commented 6 years ago

Thanks @sharkannon! Nice catch. Is there something unique about the environment that causes the projectId to be required? Just curious since I haven't observed the same error locally.

I'm +1 on merging. I think we could move the String getProjectId(String credentialFile) method up to the parent AbstractGoogleClientFactory class to avoid duplicating it, what do you think?

sharkannon commented 6 years ago

this is for work.. we have multiple projects, wondering if that's the problem.

As for moving it up, if you want to, go for it... TBH I'm not really a java dev and this was pushing my java knowledge :)

nblair commented 6 years ago

I think you're right, multiple projects may be the cause.

Integration tests look to pass locally. Have you confirmed this works in a Nexus Repository Manager 3.13 install?

sharkannon commented 6 years ago

No, I'd already upgraded my system to 3.14 so couldn't backport.

sharkannon commented 6 years ago

downgrade I mean

nblair commented 6 years ago

Ok - I'll give it a quick run later tonight, and likely merge both this and #16. Thank you!