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: Cannot invoke method getFile() on null object" during build test #33

Closed g0blin79 closed 5 years ago

g0blin79 commented 5 years ago

I'm trying to build this plugin and I have an error during tests of failsafe-reports.

These is my build steps:

Tried also using master branch, with same result.

This is my stack trace

[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT
[ERROR] Tests run: 19, Failures: 0, Errors: 19, Skipped: 0, Time elapsed: 2.939 s <<< FAILURE! - in org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT
[ERROR] isWritable true for buckets created by the Integration Test(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.298 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] isWritable true for buckets created by the Integration Test(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.308 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] isGroupable is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] isGroupable is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.012 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] getDirectPathBlobIdStream returns empty stream for missing prefix(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] getDirectPathBlobIdStream returns empty stream for missing prefix(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] getDirectPathBlobIdStream returns expected content(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] getDirectPathBlobIdStream returns expected content(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.013 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] undelete successfully makes blob accessible(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.006 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] undelete successfully makes blob accessible(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.007 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] undelete does nothing when dry run is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.012 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] undelete does nothing when dry run is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.013 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] undelete does nothing on non-existent blob(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.003 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] undelete does nothing on non-existent blob(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.004 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] create after keep-alive window closes is still successful(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.004 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] create after keep-alive window closes is still successful(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.004 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] mimic storage facet write-temp-and-move(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method getFile() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.setup(GoogleCloudBlobStoreIT.groovy:96)

[ERROR] mimic storage facet write-temp-and-move(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)  Time elapsed: 0.002 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke method stop() on null object
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanup(GoogleCloudBlobStoreIT.groovy:115)

[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT  Time elapsed: 2.539 s  <<< ERROR!
com.google.cloud.storage.StorageException: Not Found
    at com.google.cloud.storage.spi.v1.HttpStorageRpc.translate(HttpStorageRpc.java:220)
    at com.google.cloud.storage.spi.v1.HttpStorageRpc.list(HttpStorageRpc.java:347)
    at com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:299)
    at com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:296)
    at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:89)
    at com.google.cloud.RetryHelper.run(RetryHelper.java:74)
    at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:51)
    at com.google.cloud.storage.StorageImpl.listBlobs(StorageImpl.java:295)
    at com.google.cloud.storage.StorageImpl.list(StorageImpl.java:262)
    at org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.cleanupSpec(GoogleCloudBlobStoreIT.groovy:123)
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
    at com.google.cloud.storage.spi.v1.HttpStorageRpc.list(HttpStorageRpc.java:338)
    ... 8 more

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.create after keep-alive window closes is still successful(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.getDirectPathBlobIdStream returns empty stream for missing prefix(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.getDirectPathBlobIdStream returns expected content(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.isGroupable is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.isWritable true for buckets created by the Integration Test(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.mimic storage facet write-temp-and-move(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR]   GoogleCloudBlobStoreIT.cleanupSpec:123 » Storage Not Found
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.undelete does nothing on non-existent blob(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.undelete does nothing when dry run is true(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[ERROR] org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT.undelete successfully makes blob accessible(org.sonatype.nexus.blobstore.gcloud.internal.GoogleCloudBlobStoreIT)
[ERROR]   Run 1: GoogleCloudBlobStoreIT.setup:96 NullPointer Cannot invoke method getFile() on ...
[ERROR]   Run 2: GoogleCloudBlobStoreIT.cleanup:115 NullPointer Cannot invoke method stop() on ...
[INFO]
[INFO]
[ERROR] Tests run: 10, Failures: 0, Errors: 10, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.0:verify (default) @ nexus-blobstore-google-cloud ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:16 min
[INFO] Finished at: 2019-05-26T14:47:49Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.0:verify (default) on project nexus-blobstore-google-cloud: There are test failures.
[ERROR]
[ERROR] Please refer to /opt/nexus-blobstore-google-cloud-master/target/failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

I'm available for more info. Is there something I made wrong?

nblair commented 5 years ago

Hi @g0blin79 !

I suspect that you may be using mvn install rather than mvn package as recommended in the README. The difference here is that the install goal includes invocation of the verify goal, which triggers maven-failsafe-plugin and the integration tests.

If you want to include the integration tests in your build, you'll have to create a configuration file (that is ignored by git), see the README in https://github.com/sonatype-nexus-community/nexus-blobstore-google-cloud/tree/master/src/test/resources. The integration tests are more helpful for development; if you are just planning to deploy/use the plugin, they are unnecessary.

Can you confirm you are using the package goal and not install?

Sorry for the late reply - you've got my attention now :)