Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cbt ls error message is obtuse when using a bad instance ID #143

Open
PeteyPii opened this issue May 2, 2023 · 0 comments
Open

cbt ls error message is obtuse when using a bad instance ID #143

PeteyPii opened this issue May 2, 2023 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@PeteyPii
Copy link
Contributor

PeteyPii commented May 2, 2023

If I run cbt -instance=abc_123 ls I get an error message which does not help me diagnose my problem. I get:

$ cbt  -instance=abc_123 ls
2023/05/02 15:18:54 -creds flag unset, will use gcloud credential
2023/05/02 15:18:54 -project flag unset, will use gcloud active project
2023/05/02 15:18:54 gcloud active project is "autonomous-mote-782"
2023/05/02 15:18:54 Getting list of tables: rpc error: code = InvalidArgument desc = When parsing 'projects/autonomous-mote-782/instances/abc_123' : Instance name expected in the form 'projects/<project_id>/instances/<instance_id>'.
error details: name = DebugInfo detail = [ORIGINAL ERROR] generic::invalid_argument: When parsing 'projects/autonomous-mote-782/instances/abc_123' : Instance name expected in the form 'projects/<project_id>/instances/<instance_id>'. [google.rpc.error_details_ext] { message: "When parsing \'projects/autonomous-mote-782/instances/abc_123\' : Instance name expected in the form \'projects/<project_id>/instances/<instance_id>\'." } stack =

"Instance name expected in the form 'projects/<project_id>/instances/<instance_id>'" is very confusing since my instance name seemingly does match this pattern.

Conversely, if I do cbt -instance=abc ls, I get a better error message explaining what is wrong:

$ cbt  -instance=abc ls
2023/05/02 15:18:46 -creds flag unset, will use gcloud credential
2023/05/02 15:18:46 -project flag unset, will use gcloud active project
2023/05/02 15:18:47 gcloud active project is "autonomous-mote-782"
2023/05/02 15:18:47 Getting list of tables: rpc error: code = InvalidArgument desc = When parsing 'projects/autonomous-mote-782/instances/abc' : Invalid id for collection instances : Length should be between [6,33], but found 3 'abc'
error details: name = DebugInfo detail = [ORIGINAL ERROR] generic::invalid_argument: When parsing 'projects/autonomous-mote-782/instances/abc' : Invalid id for collection instances : Length should be between [6,33], but found 3 'abc' [google.rpc.error_details_ext] { message: "When parsing \'projects/autonomous-mote-782/instances/abc\' : Invalid id for collection instances : Length should be between [6,33], but found 3 \'abc\'" } stack =

It would be nice if the CLI told me why the instance name was unparseable or at least show me the regex which my instance ID needs to match.

@PeteyPii PeteyPii added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant