-
Notifications
You must be signed in to change notification settings - Fork 49
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
AWS Kotlin SDK Does Not Work With GraalVM #584
Comments
FYI setting 19:40:43.428 [DefaultDispatcher-worker-1] DEBUG Retry - sdkRequestId: 79b44a45-0cbe-4f30-a04e-814beb02f797; service: S3; operation: GetObject; - request failed with non-retryable error
Exception in thread "main" java.lang.UnsatisfiedLinkError: software.amazon.awssdk.crt.auth.signing.AwsSigner.awsSignerSignRequest(Lsoftware/amazon/awssdk/crt/http/HttpRequest;[BLsoftware/amazon/awssdk/crt/auth/signing/AwsSigningConfig;Ljava/util/concurrent/CompletableFuture;)V [symbol: Java_software_amazon_awssdk_crt_auth_signing_AwsSigner_awsSignerSignRequest or Java_software_amazon_awssdk_crt_auth_signing_AwsSigner_awsSignerSignRequest__Lsoftware_amazon_awssdk_crt_http_HttpRequest_2_3BLsoftware_amazon_awssdk_crt_auth_signing_AwsSigningConfig_2Ljava_util_concurrent_CompletableFuture_2]
at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:153)
at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
at software.amazon.awssdk.crt.auth.signing.AwsSigner.awsSignerSignRequest(AwsSigner.java)
at software.amazon.awssdk.crt.auth.signing.AwsSigner.sign(AwsSigner.java:76)
at aws.sdk.kotlin.crt.auth.signing.AwsSigner$sign$2.invokeSuspend(AwsSignerJVM.kt:47)
at aws.sdk.kotlin.crt.auth.signing.AwsSigner$sign$2.invoke(AwsSignerJVM.kt)
at aws.sdk.kotlin.crt.auth.signing.AwsSigner$sign$2.invoke(AwsSignerJVM.kt)
at aws.sdk.kotlin.crt.CrtExceptionUtilKt.asyncCrtJniCall(CrtExceptionUtil.kt:27)
at aws.sdk.kotlin.crt.auth.signing.AwsSigner.sign(AwsSignerJVM.kt:46)
at aws.sdk.kotlin.runtime.auth.signing.AwsSigV4SigningMiddleware.modifyRequest(AwsSigV4SigningMiddleware.kt:161)
at aws.sdk.kotlin.runtime.auth.signing.AwsSigV4SigningMiddleware.modifyRequest(AwsSigV4SigningMiddleware.kt:24)
at aws.smithy.kotlin.runtime.io.middleware.ModifyRequestMiddleware.handle(ModifyRequest.kt:24)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.io.middleware.Phase.handle(Phase.kt:64)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.http.operation.MutateHandler.call(SdkOperationExecution.kt:131)
at aws.smithy.kotlin.runtime.http.operation.MutateHandler.call(SdkOperationExecution.kt:128)
at aws.smithy.kotlin.runtime.io.middleware.ModifyRequestMiddleware.handle(ModifyRequest.kt:24)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.http.middleware.Retry$handle$outcome$1.invokeSuspend(Retry.kt:51)
at aws.smithy.kotlin.runtime.http.middleware.Retry$handle$outcome$1.invoke(Retry.kt)
at aws.smithy.kotlin.runtime.http.middleware.Retry$handle$outcome$1.invoke(Retry.kt)
at aws.smithy.kotlin.runtime.retries.StandardRetryStrategy.doTryLoop(StandardRetryStrategy.kt:51)
at aws.smithy.kotlin.runtime.retries.StandardRetryStrategy.retry(StandardRetryStrategy.kt:32)
at aws.smithy.kotlin.runtime.http.middleware.Retry.handle(Retry.kt:36)
at aws.smithy.kotlin.runtime.http.middleware.Retry.handle(Retry.kt:25)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.io.middleware.ModifyRequestMiddleware.handle(ModifyRequest.kt:24)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.io.middleware.Phase.handle(Phase.kt:64)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.http.operation.SerializeHandler.call(SdkOperationExecution.kt:124)
at aws.smithy.kotlin.runtime.http.operation.SerializeHandler.call(SdkOperationExecution.kt:107)
at aws.smithy.kotlin.runtime.http.operation.InitializeHandler.call(SdkOperationExecution.kt:104)
at aws.smithy.kotlin.runtime.io.middleware.Phase.handle(Phase.kt:60)
at aws.smithy.kotlin.runtime.io.middleware.DecoratedHandler.call(Middleware.kt:40)
at aws.smithy.kotlin.runtime.http.operation.SdkHttpOperationKt.execute(SdkHttpOperation.kt:83)
at aws.sdk.kotlin.services.s3.DefaultS3Client.getObject(DefaultS3Client.kt:2919)
at com.mdai.backend.datasources.inputs.InputArtifactsHttpDataSource$getInputs$2.invokeSuspend(InputArtifactsHttpDataSource.kt:28)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:597)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:194) |
Hi @AlexandreBrown, thanks for the issue report. Currently the AWS SDK for Kotlin does not support GraalVM although we'd like to in the future. We believe that running the SDK with the CRT on GraalVM will likely require build configuration changes to aws-crt-java in order to work. That being said, we are actively working on removing the CRT as a hard requirement for the SDK. Once those changes are complete, it'll be much simpler to offer GraalVM support. We'll leave this open as a tracking issue and other users can 👍 to vote for its prioritization. |
Useful info for setting up graal native tests when we get around to this:
I have not verified anything but it's worth mentioning that the CRT is no longer a hard dependency in the default configuration of the SDK. If you tried to create a native image before and got stuck on CRT/linking issues maybe give it another go and report back what you find. |
Has anyone tried this with the GA release? 🤔 |
@zeletrik I tried to build a Kotlin (w/ Quarkus) application, using AWS Kotlin SDK v1.0.51, and here is the output:
All errors have same pattern EDIT: all issues where related to Quarkus build which enables |
Hi, I'm happy to share that the latest version of the AWS SDK for Kotlin (v1.2.44) now supports GraalVM native image compilation for both the OkHttpEngine (default) and CrtHttpEngine! Note that log4j2 does not support GraalVM native image compilation yet, so you may need to change your logging configuration to get it working. If you run into any problems, please feel free to open a new issue. |
|
Describe the bug
When creating a static native image using GraalVM, we get runtime errors that seem to relate to the AWS Kotlin SDK.
Expected behavior
We are able to build and run native images that use the AWS Kotlin SDK.
Current behavior
We can create a static native image but we get an exception at runtime.
Steps to Reproduce
META-INF/native-image
Possible Solution
Provide the necessary configuration missing (reflection config or jni config) for GraalVM to work.
Context
Tested with GraalVM 22.0.0.2 java 11 and GraalVM 22.0.0.2 java 17, both yield same result.
AWS Kotlin SDK version used
0.14.2-beta
Platform (JVM/JS/Native)
JVM/Native
Operating System and version
Ubuntu 20.04.3 LTS
The text was updated successfully, but these errors were encountered: