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

findCollections and createCollection do not show the correct error message when the Astra token is invalid #712

Open
Hazel-Datastax opened this issue Dec 7, 2023 · 1 comment · Fixed by #1119

Comments

@Hazel-Datastax
Copy link
Contributor

Hazel-Datastax commented Dec 7, 2023

When an Astra token is used in the wrong database context, there is an issue with the connection handling. For example, if Token A, which is created for use with Database A, is mistakenly used for Database B, the connection should be refused. However, currently, the connection is established successfully, and it results in an error message Unknown namespace. This is misleading as the real issue is the use of an invalid token for the given database. Therefore, the error message should be changed to Invalid token.

The current error message is:

{
    "errors": [
        {
            "message": "INVALID_ARGUMENT: Unknown namespace 'default_keyspace', you must create it first.",
            "errorCode": "NAMESPACE_DOES_NOT_EXIST"
        }
    ]
}

The error message should be:

{
    "errors": [
        {
            "message": "UNAUTHENTICATED: Invalid token"
        }
    ]
}
@Hazel-Datastax Hazel-Datastax self-assigned this Dec 7, 2023
@Hazel-Datastax Hazel-Datastax changed the title findCollections and createCollection do not show the correct error when astra token is invalid findCollections and createCollection do not show the correct error message when the Astra token is invalid Dec 7, 2023
@jeffreyscarpenter
Copy link
Contributor

we had to back out the change in #1138, reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants