-
Notifications
You must be signed in to change notification settings - Fork 649
Closed
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.coretype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
It seems like we're not properly constructing the request?
I first noticed this when trying to get the schema of a table (I'd already run gcloud config set project <myproject>)
> var gcloud = require('google-cloud');
undefined
> var spanner = gcloud.spanner();
undefined
> var instance = spanner.instance('my-instance');
undefined
> var db = instance.database('my-db');
undefined
> db.getSchema(console.log);
undefined
> { Error: Invalid GetDatabaseDdl request.
at /usr/local/google/home/jjg/node_modules/google-cloud/node_modules/grpc/src/node/src/client.js:434:17
code: 3,
metadata:
Metadata {
_internal_repr:
{ 'google.rpc.badrequest-bin': [Object],
'google.rpc.debuginfo-bin': [Object] } },
note: 'Exception occurred in retry method that was not classified as transient' }Then thought that I should try it higher up the chain...
> instance.exists(console.log);
undefined
> { Error: Invalid GetInstance request.
at /usr/local/google/home/jjg/node_modules/google-cloud/node_modules/grpc/src/node/src/client.js:434:17
code: 3,
metadata:
Metadata {
_internal_repr:
{ 'google.rpc.badrequest-bin': [Object],
'google.rpc.debuginfo-bin': [Object] } },
note: 'Exception occurred in retry method that was not classified as transient' }
I tried re-creating the spanner object with an explicit project ID, and that fixed the problem.
Can we throw a better error if the project ID wasn't detected? Saying "the request was invalid" is super not helpful.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.coretype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.