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

"Error loading shared library ld-linux-x86-64.so.2" on Alpine #483

Closed
mflis opened this issue Dec 29, 2021 · 5 comments
Closed

"Error loading shared library ld-linux-x86-64.so.2" on Alpine #483

mflis opened this issue Dec 29, 2021 · 5 comments
Labels
bug This issue is a bug.

Comments

@mflis
Copy link

mflis commented Dec 29, 2021

Describe the bug

Running aws-sdk-kotlin on Alpine linux results in following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/AWSCRT_164078280020313186175181261409494libaws-crt-jni.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/AWSCRT_164078280020313186175181261409494libaws-crt-jni.so)

Java AWS SDK (""software.amazon.awssdk:aws-sdk-java") works fine on Alpine Linux.
As a workaround I changed my base docker image from Alpine to CentOS

Expected behavior

aws-sdk-kotlin works fine on Alpine Linux

Current behavior

Trying to create S3Client results in following stacktrace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/AWSCRT_164078473572713457532869063683722libaws-crt-jni.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/AWSCRT_164078473572713457532869063683722libaws-crt-jni.so)
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
	at java.base/java.lang.Runtime.load0(Runtime.java:755)
	at java.base/java.lang.System.load(System.java:1953)
	at software.amazon.awssdk.crt.CRT.extractAndLoadLibrary(CRT.java:189)
	at software.amazon.awssdk.crt.CRT.loadLibraryFromJar(CRT.java:223)
	at software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:33)
	at software.amazon.awssdk.crt.CrtResource.<clinit>(CrtResource.java:100)
	at aws.sdk.kotlin.crt.io.EventLoopGroup.<init>(EventLoopGroupJVM.kt:22)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$EventLoop$2.invoke(SdkDefaultIO.kt:24)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$EventLoop$2.invoke(SdkDefaultIO.kt:22)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO.getEventLoop(SdkDefaultIO.kt:22)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$ClientBootstrap$2.invoke(SdkDefaultIO.kt:38)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$ClientBootstrap$2.invoke(SdkDefaultIO.kt:37)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO.getClientBootstrap(SdkDefaultIO.kt:37)
	at aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine.<init>(CrtHttpEngine.kt:60)
	at aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine.<init>(CrtHttpEngine.kt:32)
	at aws.sdk.kotlin.services.s3.DefaultS3Client.<init>(DefaultS3Client.kt:37)
	at aws.sdk.kotlin.services.s3.S3Client$Companion.invoke(S3Client.kt:46)
	at aws.sdk.kotlin.services.s3.S3Client$Companion.invoke$default(S3Client.kt:40)
	at com.marcinf.MainKt.main(Main.kt:7)
	at com.marcinf.MainKt.main(Main.kt)

Steps to Reproduce

git clone https://github.com/mflis/aws-kotlin-alpine-error.git
./gradlew jibDockerBuild
docker run aws-alpine-error

Possible Solution

No response

Context

We use alpine linux as a standard base container in our company to achieve small docker images.

AWS Kotlin SDK version used

aws.sdk.kotlin:s3:0.9.5-beta

Platform (JVM/JS/Native)

JVM

Operating System and version

Alpine Linux v3.14

@mflis mflis added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 29, 2021
@kggilmer
Copy link
Contributor

Hi @mflis , thanks for providing the issue and easy repro steps. At this time an internal dependency of the AWS SDK for Kotlin (CRT) does not support Alpine Linux.

Unlike the Java v2 SDK, at this time it is not possible to use the Kotlin SDK without CRT, so this is blocking the usage of applications using the Kotlin SDK on Alpine and other musl-based distributions.

@kggilmer kggilmer removed the needs-triage This issue or PR still needs to be triaged. label Dec 29, 2021
@ianbotsf
Copy link
Contributor

ianbotsf commented Jun 6, 2022

This should be fixed in 0.16.1-beta since the SDK no longer uses the CRT by default.

NOTE: Multi Region Access Points (which the SDK does not yet support, see #625) still may require explicitly configuring a CRT based signer, we are still investigating paths forward.

@ianbotsf ianbotsf closed this as completed Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@carmithersh
Copy link

Hi, any updates on this? I am trying out awssdk 2.20.102 and awssdk.crt 0.22.5 and it still fails.
is there a workaround this issue?

@ianbotsf
Copy link
Contributor

Hi @carmithersh, 2.20.102 is the latest version of the AWS SDK for Java whereas this issue was for the AWS SDK for Kotlin. You can follow the issue for supporting CRT on Alpine Linux for AWS SDK for Java at aws-sdk-java-v2#2868.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants