astra-cli
astra-cli copied to clipboard
NullPointerException if the database has no keyspaces
See the following output. This database is having some issues with cqlsh connection and download-scb. astra-cli could have better error handling and outputs something like: "the database is in a bad state. DevOps API call on xxx is broken", which would be more meaningful to the end users.
Wei-Deng-C5JFWMWMVP:erato weideng$ astra db list --profile dev | head -n 4
┌──────────────────────────────────┬──────────────────────────────────────┬─────────────────────────────┬────────┬────┬──────────┐
│ Name │ ID │ Regions │ Cloud │ V │ Status │
├──────────────────────────────────┼──────────────────────────────────────┼─────────────────────────────┼────────┼────┼──────────┤
│ sstsldev_clone_target_awsuswest2 │ d4399c8b-eaee-4c69-9065-b7558ec5d254 │ [0] us-west-2 │ AWS │ │ 'ACTIVE' │
Wei-Deng-C5JFWMWMVP:erato weideng$ astra db cqlsh start --profile dev sstsldev_clone_target_awsuswest2
An unexpected error occurred during the execution of the command (NullPointerException):
> Stack trace is imprecise, the top frames are missing and/or have wrong line numbers. To get precise stack traces, build the image with option -H:-ReduceImplicitExceptionStackTraceInformation
If necessary, file an issue here: https://github.com/datastax/astra-cli/issues/new?template=bug_report.md
A full debug log was generated at /Users/weideng/.astra/logs/2025-11-20_15-38-10.astra.log
Wei-Deng-C5JFWMWMVP:erato weideng$ cat /Users/weideng/.astra/logs/2025-11-20_15-38-10.astra.log
[STARTED] Fetching info for database sstsldev_clone_target_awsuswest2
[DONE] Fetching info for database sstsldev_clone_target_awsuswest2
[ERROR] java.lang.NullPointerException: Stack trace is imprecise, the top frames are missing and/or have wrong line numbers. To get precise stack traces, build the image with option -H:-ReduceImplicitExceptionStackTraceInformation
at com.dtsx.astra.cli.gateways.db.DbCache.cache(DbCache.java:20)
at [email protected]/java.util.Optional.ifPresent(Optional.java:178)
at com.dtsx.astra.cli.gateways.APIProviderImpl.tryResolveDb(APIProviderImpl.java:151)
at com.dtsx.astra.cli.gateways.db.DbGatewayImpl.lambda$tryFindOne$0(DbGatewayImpl.java:55)
at com.dtsx.astra.cli.core.output.AstraLogger.loading(AstraLogger.java:135)
at com.dtsx.astra.cli.gateways.db.DbGatewayImpl.tryFindOne(DbGatewayImpl.java:54)
at com.dtsx.astra.cli.gateways.db.DbGatewayCompletionsCacheWrapper.tryFindOne(DbGatewayCompletionsCacheWrapper.java:37)
at com.dtsx.astra.cli.gateways.db.DbGateway.findOne(DbGateway.java:28)
at com.dtsx.astra.cli.operations.db.cqlsh.AbstractCqlshExeOperation.downloadSCB(AbstractCqlshExeOperation.java:159)
at com.dtsx.astra.cli.operations.db.cqlsh.DbCqlshStartOperation.buildCommandLine(DbCqlshStartOperation.java:48)
at com.dtsx.astra.cli.operations.db.cqlsh.AbstractCqlshExeOperation.lambda$execute$0(AbstractCqlshExeOperation.java:51)
at com.dtsx.astra.cli.core.datatypes.Either.flatMap(Either.java:89)
at com.dtsx.astra.cli.operations.db.cqlsh.AbstractCqlshExeOperation.execute(AbstractCqlshExeOperation.java:51)
at com.dtsx.astra.cli.operations.db.cqlsh.AbstractCqlshExeOperation.execute(AbstractCqlshExeOperation.java:26)
at com.dtsx.astra.cli.commands.AbstractCmd.lambda$evokeProperExecuteFunction$0(AbstractCmd.java:177)
at com.dtsx.astra.cli.core.datatypes.Thunk.get(Thunk.java:15)
at com.dtsx.astra.cli.commands.db.cqlsh.AbstractCqlshExecCmd.executeHuman(AbstractCqlshExecCmd.java:69)
at com.dtsx.astra.cli.commands.AbstractCmd.evokeProperExecuteFunction(AbstractCmd.java:181)
at com.dtsx.astra.cli.commands.AbstractCmd.run(AbstractCmd.java:140)
at com.dtsx.astra.cli.commands.AbstractCmd.run(AbstractCmd.java:121)
at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2423)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2425)
at picocli.CommandLine.execute(CommandLine.java:2174)
at com.dtsx.astra.cli.AstraCli.run(AstraCli.java:200)
at com.dtsx.astra.cli.AstraCli.main(AstraCli.java:152)
at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)