astra-cli icon indicating copy to clipboard operation
astra-cli copied to clipboard

[BUG] Cannot "setup" due to linking issue in 0.5

Open michaeljmarshall opened this issue 2 years ago • 6 comments
trafficstars

Describe the bug

Use astra-cli to connect to astra.

To Reproduce

  1. brew install datastax/astra-cli/astra-cli
  2. astra setup and 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/

michaeljmarshall avatar Nov 10 '23 17:11 michaeljmarshall

The workaround is to pass in secrets as arguments using astra setup --token AstraCs...

michaeljmarshall avatar Nov 14 '23 14:11 michaeljmarshall

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 avatar Dec 15 '23 19:12 smatiolids

@smatiolids for workaround, you could add your token as below at ~/.astrarc:

[default]
ASTRA_DB_APPLICATION_TOKEN=AstraCS:Il...4b4de

msmygit avatar Feb 14 '24 15:02 msmygit

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: Screenshot 2024-05-27 at 18 29 18

If invalid token: Screenshot 2024-05-27 at 18 26 11

clun avatar May 27 '24 15:05 clun

Does anyone know how to install the 0.6 version of astra-cli using Homebrew?

meowalien avatar Jun 11 '24 05:06 meowalien

0.6 has not been released yet. it is expected for this week.

astra setup --token TOKEN

should already work in 0.,5 though

clun avatar Jun 11 '24 08:06 clun