Skip to content

Better error messages when things fail #399

@jimmyruska

Description

@jimmyruska

This is to write down some feedback we've received based on a client using this jdbc driver

  • Problem: They tried using the JDBC driver but it failed with errors about SpannerException not being found: "Caused by: java.lang.ClassNotFoundException: com.google.cloud.spanner.SpannerException". This was because they were trying to use the jdbc driver with sqlline, a generic database tool that works with any JDBC, but the default JDBC download does not contain dependencies.

  • Resolution: Make the default JDBC driver download have all dependencies. If possible add error messages that say dependencies don't exist but are required

  • Problem: When trying to connect to spanner they were getting strange error messages. "Error: UNAVAILABLE: com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception (state=,code=14)"

  • Resolution: The connection string still had emulator variables like localhost, and usePlainText=true, potentially "gcloud config set auth/disable_credentials true" could have been set. It would be helpful if there are better error messages like, "Connection could not be established to through grpc, check connection string".

  • Problem: They received an error "com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: Invalid credentials path specified"

  • Resolution: Potentially the environment variable "GOOGLE_APPLICATION_CREDENTIALS" is pointing to the wrong path, or the default authentication file does not exist. If there could be an error message, like "$HOME/.config/gcloud/application_default_credentials.json" does not exist, please try clearing GOOGLE_APPLICATION_CREDENTIALS and running "gcloud auth application-default login" or activating a service key"

This post is just to relay the feedback, maybe I can help in implementing these eventually.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/java-spanner-jdbc API.documentationImprovements or additions to documentationtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions