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

Unshade auth-crt due to known issue #1015

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

noCharger
Copy link
Collaborator

@noCharger noCharger commented Jan 9, 2025

Description

  • Unshaded auth-crt library to address the UnsatisfiedLinkError. This change is necessary due to a known issue where a temporary library copy is created for loading, and the CRT_LIB_NAME constant cannot be altered.

Related Issues

awslabs/aws-crt-java#166

java.lang.NoClassDefFoundError: Could not initialize class shaded.flint.software.amazon.awssdk.crt.auth.signing.AwsSigningConfig
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createStringToSignConfig(SigningConfigProvider.java:111) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createDefaultRequestConfig(SigningConfigProvider.java:91) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createCrtSigningConfig(SigningConfigProvider.java:41) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.DefaultAwsCrtV4aSigner.sign(DefaultAwsCrtV4aSigner.java:58) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at org.opensearch.flint.core.auth.AWSRequestSigV4ASigningApacheInterceptor.signRequest(AWSRequestSigV4ASigningApacheInterceptor.java:171) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at org.opensearch.flint.core.auth.AWSRequestSigV4ASigningApacheInterceptor.process(AWSRequestSigV4ASigningApacheInterceptor.java:85) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at org.opensearch.flint.core.auth.ResourceBasedAWSRequestSigningApacheInterceptor.process(ResourceBasedAWSRequestSigningApacheInterceptor.java:91) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:133) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
...
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: 'void shaded.flint.software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean, boolean)' [in thread "main"]
	at shaded.flint.software.amazon.awssdk.crt.CRT.awsCrtInit(Native Method) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:62) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.crt.CrtResource.<clinit>(CrtResource.java:104) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createStringToSignConfig(SigningConfigProvider.java:111) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createDefaultRequestConfig(SigningConfigProvider.java:91) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.SigningConfigProvider.createCrtSigningConfig(SigningConfigProvider.java:41) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]
	at shaded.flint.software.amazon.awssdk.authcrt.signer.internal.DefaultAwsCrtV4aSigner.sign(DefaultAwsCrtV4aSigner.java:58) ~[opensearch-spark-standalone_2.12-latest.jar:0.6.0-SNAPSHOT]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there other impact to unshade this jar?

@noCharger
Copy link
Collaborator Author

Is there other impact to unshade this jar?

It would cause conflict error if someone attempted to build an image with more jars than the flint ones, and those jars were also using auth-crt lib with different versions.

@noCharger noCharger merged commit 974d7d4 into opensearch-project:main Jan 10, 2025
6 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 10, 2025
Signed-off-by: Louis Chu <[email protected]>
(cherry picked from commit 974d7d4)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
noCharger pushed a commit that referenced this pull request Jan 10, 2025
(cherry picked from commit 974d7d4)

Signed-off-by: Louis Chu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants