Immutable solution version
Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh
Complete solution
How to fix: Astra CLI: NullPointerException ("keyspaces" is null) on astra db cqlsh. The verified fix from the maintainer thread, distilled into reusable steps.
What happened
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 fix that worked
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.
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 1 · 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 ("keyspaces" is null) on astra db cqlsh <span>— Vectle</span></a>