Open lvh opened 7 years ago
That is a terrible error message agreed, and should definitely be fixed. You may know this already, but one way to configure GCP libraries is with application default credentials. I suspect that error may be coming because that project doesn't exist? Although I don't really know.
@danielcompton Yep, the error happens in dev with no GCP creds set in the environment. I don't know if it works with a valid project but otherwise no creds set -- I presume there are no preauth APIs for it to hit.
@danielcompton Do you happen to know if the application default credentials are enabled by default if you don't specify other credentials? https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java#L190 suggests yes, but I'm still getting the same error in prod.
GCS works for me without any explicit settings, this returns a com.google.cloud.storage.Storage
.
(let [options (StorageOptions/getDefaultInstance)
service (.getService options)]
(assoc this :service service))
Your update to build-client looks fine to me. This seems a bit suspicious though: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java#L91. I got a bit lost in the layers of abstractions to figure out if the GCS client was doing something different.
Just to follow up: I'm now more likely to believe you're right and that it is a logging-specific issue. Storage client works fine.
If this is done in an environment with no GCP creds, project ID... configured, you get the following exception when evaluating
(LoggingOptions/getDefaultInstance)
:Per the exception, I tried:
The source code confirms that
(.build (LoggingOptions/newBuilder))
is what the default implementation ((LoggingOptions/getDefaultInstance)
) does anyway, so I was hopeful this would work. It does evaluate to a LoggingOptions instance, but when you call getService you get a totally inscrutable error message:Maybe I'm doing something wrong, but an error message that bad seems like it should probably be fixed upstream :)
As a consequence of all of this, I can't really test this part of the code. Suggestions include setting whatever JVM properties or whatever the code wants to successfully create that instance.