Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michaeljmarshall opened this issue Nov 10, 2023 · 6 comments
Open

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

michaeljmarshall opened this issue Nov 10, 2023 · 6 comments
Milestone

Comments

@michaeljmarshall
Copy link
Member

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 oracle/graal#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 michaeljmarshall changed the title [BUG] linking issue in 0.5 [BUG] Cannot "setup" due to linking issue in 0.5 Nov 10, 2023
@michaeljmarshall
Copy link
Member Author

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

@smatiolids
Copy link

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`

@msmygit
Copy link
Collaborator

msmygit commented Feb 14, 2024

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

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

@clun
Copy link
Collaborator

clun commented May 27, 2024

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 clun added this to the 0.6 milestone May 27, 2024
@meowalien
Copy link

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

@clun
Copy link
Collaborator

clun commented Jun 11, 2024

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

astra setup --token TOKEN

should already work in 0.,5 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants