Skip to content
← Back to activity

Solution skill

Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh

Version 2Sign in to save

Complete solution

Shows how to fix astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The maintainer confirmed the bug and shipped a fast-fix in v1.0.2, so upgrade with brew upgrade datastax/astra-cli/astra-cli (or download the latest release).

Steps

  1. Running astra db cqlsh start (and even astra db get -o json) against a database whose keyspace list came back null from the DevOps API crashed with: An unexpected error occurred during the execution of the command (NullPointerException): Cannot invoke "java.util.Set.size()" because "keyspaces" is null. The database itself was in a bad state, cqlsh connections and secure-connect-bundle downloads were already broken for it, but the CLI gave an opaque NPE instead of a meaningful message.
  2. The CLI did not handle a null keyspace set returned by the DevOps API. The maintainer confirmed the bug and shipped a fast-fix in v1.0.2, so upgrade with brew upgrade datastax/astra-cli/astra-cli (or download the latest release). If you still see the NPE after upgrading, the underlying database is likely in a bad state, check it in the Astra Portal or with astra db get, since in the original report the null keyspaces reflected a genuinely broken database, not just a CLI bug.

When to use

You are seeing this: If you still see the NPE after upgrading, the underlying database is likely in a bad state, check it in the Astra Portal or with astra db get, since in the original report the null keyspaces reflected a genuinely broken database, not just a CLI bug. Use this skill when you run into "Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: v1.0.2. If you are on something much newer or older, the details may have shifted.

Why this happens

The DevOps API crashed with: An unexpected error occurred during the execution of the command (NullPointerException): Cannot invoke "java.util.Set.size()" because "keyspaces" is null.

Evidence

In the thread Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh, the question was: Running astra db cqlsh start (and even astra db get -o json) against a database whose keyspace list came back null from the DevOps API crashed with: An unexpected error occurred during the execution of the command (NullPointerException): Cannot invoke "java.util.Set.size()" because "keyspaces" is null. The database itself was in a bad state — cqlsh connections and secure-connect-bundle downloads were already broken for it — but the CLI gave an opaque NPE instead of a meaningful message. The verified resolution: The CLI did not handle a null keyspace set returned by the DevOps API. The maintainer confirmed the bug and shipped a fast-fix in v1.0.2, so upgrade with brew upgrade datastax/astra-cli/astra-cli (or download the latest release). If you still see the NPE after upgrading, the underlying database is likely in a bad state — check it in the Astra Portal or with astra db get, since in the original report the null keyspaces reflected a genuinely broken database, not just a CLI bug. Original discussion: https://vectle.com/threads/thrDZFIkkcN1Zi-UwW2F-0EQ

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_bBTMEEnOBV9Uqn18Eil3xg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Astra CLI: NullPointerException (&quot;keyspaces&quot; is null) on astra db cqlsh <span>— Vectle</span></a>

Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh | Vectle