astra-cli
astra-cli copied to clipboard
[BUG] Cannot "setup" due to linking issue in 0.5
Describe the bug
Use astra-cli to connect to astra.
To Reproduce
brew install datastax/astra-cli/astra-cliastra setupand observe:
$ astra setup
_____ __
/ _ \ _______/ |_____________
/ /_\ \ / ___/\ __\_ __ \__ \
/ | \\___ \ | | | | \ //__ \_
\____|__ /____ > |__| |__| (____ /
\/ \/ \/
Version: 0.5
Exception in thread "main" java.lang.UnsatisfiedLinkError: jdk.internal.io.JdkConsoleImpl.echo(Z)Z [symbol: Java_jdk_internal_io_JdkConsoleImpl_echo or Java_jdk_internal_io_JdkConsoleImpl_echo__Z]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:152)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:54)
at java.base@21/jdk.internal.io.JdkConsoleImpl.echo(Native Method)
at java.base@21/jdk.internal.io.JdkConsoleImpl.readPassword(JdkConsoleImpl.java:101)
at java.base@21/java.io.ProxyingConsole.readPassword(ProxyingConsole.java:117)
at com.dtsx.astra.cli.config.SetupCmd.execute(SetupCmd.java:75)
at com.dtsx.astra.cli.core.AbstractCmd.run(AbstractCmd.java:89)
at com.dtsx.astra.cli.AstraCli.run(AstraCli.java:280)
at com.dtsx.astra.cli.AstraCli.main(AstraCli.java:255)
at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Desktop (please complete the following information):
$ astra --version
0.5
Additional context Looks like a similar issue to https://github.com/oracle/graal/issues/7567, which was already patched but isn't yet released. We'll need 21.0.2. See: https://github.com/graalvm/graalvm-ce-builds/releases/
The workaround is to pass in secrets as arguments using astra setup --token AstraCs...
It worked for the setup command, but the setup wasn't really completed, as it is still using an old token for the following commands.
samuel.matioli@samuel-matioli-VM2D7270XT ~ % astra setup
_____ __
/ _ \ _______/ |_____________
/ /_\ \ / ___/\ __\_ __ \__ \
/ | \\___ \ | | | | \ //__ \_
\____|__ /____ > |__| |__| (____ /
\/ \/ \/
Version: 0.5
Exception in thread "main" java.lang.UnsatisfiedLinkError: jdk.internal.io.JdkConsoleImpl.echo(Z)Z [symbol: Java_jdk_internal_io_JdkConsoleImpl_echo or Java_jdk_internal_io_JdkConsoleImpl_echo__Z]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:152)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:54)
at [email protected]/jdk.internal.io.JdkConsoleImpl.echo(Native Method)
at [email protected]/jdk.internal.io.JdkConsoleImpl.readPassword(JdkConsoleImpl.java:101)
at [email protected]/java.io.ProxyingConsole.readPassword(ProxyingConsole.java:117)
at com.dtsx.astra.cli.config.SetupCmd.execute(SetupCmd.java:75)
at com.dtsx.astra.cli.core.AbstractCmd.run(AbstractCmd.java:89)
at com.dtsx.astra.cli.AstraCli.run(AstraCli.java:280)
at com.dtsx.astra.cli.AstraCli.main(AstraCli.java:255)
at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
samuel.matioli@samuel-matioli-VM2D7270XT ~ % astra setup --token AstraCS:GU...eb519c
[OK] Configuration has been saved.
[OK] Setup completed.
[INFO] Enter 'astra help' to list available commands.
samuel.matioli@samuel-matioli-VM2D7270XT ~ % astra role list
[ERROR] CONFIGURATION: Token 'AstraCS:Il...4b4de' is invalid`
@smatiolids for workaround, you could add your token as below at ~/.astrarc:
[default]
ASTRA_DB_APPLICATION_TOKEN=AstraCS:Il...4b4de
Starting 0.6 the setup command will force the user to provide a token or will give an explicit message to avoid the linking issues.
astra setup --token TOKEN
if not token:
If invalid token:
Does anyone know how to install the 0.6 version of astra-cli using Homebrew?
0.6 has not been released yet. it is expected for this week.
astra setup --token TOKEN
should already work in 0.,5 though