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

[BUG] Some Astra CLI command can work with DB ids, but NOT with DB names. #162

Open
billtang-datastax opened this issue Feb 22, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@billtang-datastax
Copy link

Describe the bug
Astra CLI v0.5

The following commands can only work with DB ids but not valid DB name:

  • get
  • describe
  • create-keyspace
  • list-keyspaces
  • There might be more

To Reproduce

Steps to reproduce the behavior:

  1. Generate a token with DB Admin role
  2. Config token in Astra DB CLI v0.5
  3. Run the above command with a valid DB id, make sure you can get expected results.
  4. Run the above command with the DB name
  5. The error message appear after execution failure:
    [ERROR] INTERNAL_ERROR: Error in HTTP Request: HttpEntity

Expected behavior
If the commands work with DB id, they should work with DB name.
as documented here:
https://docs.datastax.com/en/astra-cli/docs/0.2/managing.html#get-database-details

Screenshots

bill.tang@Bill-Tang-DXJCJ4T4L0 ~ % astra db list -v
[DEBUG] Configuration: Parsing file /Users/bill.tang/.astrarc ...
[DEBUG] Configuration: [OK] Configurations are [default]
[DEBUG] Configuration: Using token in section default
[DEBUG] Token: AstraCS:JFvzOZjTQmzI...
+---------------------+--------------------------------------+--------------+-------+---+-----------+
| Name | id | Regions | Cloud | V | Status |
+---------------------+--------------------------------------+--------------+-------+---+-----------+
| first_slv_db | c7c463a8-ebda-4625-a370-b8e1343ebe32 | centralindia | azure | ■ | ACTIVE |
+---------------------+--------------------------------------+--------------+-------+---+-----------+

bill.tang@Bill-Tang-DXJCJ4T4L0 ~ % astra token list
+--------------------------+--------------------------+-------------------------------------+
| Generated On | Client Id | Role |
+--------------------------+--------------------------+-------------------------------------+
| 2024-02-20T04:07:52.827Z | JFvzOZjTQmzIPUTGcgSjgXLY | first_slv_db Database Administrator |
+--------------------------+--------------------------+-------------------------------------+
bill.tang@Bill-Tang-DXJCJ4T4L0 ~ % astra db get c7c463a8-ebda-4625-a370-b8e1343ebe32
+------------------+-----------------------------------------+
| Attribute | Value |
+------------------+-----------------------------------------+
| Name | first_slv_db |
| id | c7c463a8-ebda-4625-a370-b8e1343ebe32 |
| Cloud | AZURE |
| Regions | centralindia |
| Status | ACTIVE |
| Vector | Enabled |
| Default Keyspace | default_keyspace |
| Creation Time | 2024-02-20T04:04:15Z |
| | |
| Keyspaces | [0] ks1 |
| | [1] default_keyspace |
| | [2] ks2 |
| | |
| | |
| Regions | [0] centralindia |
| | |
+------------------+-----------------------------------------+
bill.tang@Bill-Tang-DXJCJ4T4L0 ~ % astra db get first_slv_db -v
[DEBUG] Configuration: Parsing file /Users/bill.tang/.astrarc ...
[DEBUG] Configuration: [OK] Configurations are [default]
[DEBUG] Configuration: Using token in section default
[DEBUG] Token: AstraCS:JFvzOZjTQmzI...
[ERROR] INTERNAL_ERROR: Error in HTTP Request: HttpEntity

Desktop (please complete the following information):

  • OS: [MacOS]
  • Version [14.3.1]

Additional context
It'll be nice to have more details in the error message.

@clun
Copy link
Collaborator

clun commented Mar 8, 2024

The error came because you are using a token that is not admin and cannot do the lookup dbid->dbname i think but the error needs to be more explicit.

@clun clun added the documentation Improvements or additions to documentation label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants