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

Quarkus 3.2.2 native compiler fails on AWS S3 library #857

Open
scrocquesel opened this issue Jul 25, 2023 · 31 comments · Fixed by #858
Open

Quarkus 3.2.2 native compiler fails on AWS S3 library #857

scrocquesel opened this issue Jul 25, 2023 · 31 comments · Fixed by #858
Assignees
Labels
bug Something isn't working

Comments

@scrocquesel
Copy link
Member

Discussed in quarkusio/quarkus#35004

Originally posted by gquintana July 25, 2023
After upgrading from Quarkus 3.1.3.Final to 3.2.2.Final
and quarkus-amazon-services-bom 2.3.2 (io.quarkiverse.amazonservices) to 3.2.2.Final (io.quarkus.platform)
and same aws sdk 2.20.90,
GraalVM native compilation fails on AWS S3 code

48328 [INFO] --- quarkus:3.2.2.Final:build (default) @ myapp-lambda-read-api ---
71135 [WARNING] [io.quarkus.arc.deployment.SplitPackageProcessor] Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives: 
- "com.mycompany.myapp.sse.service" found in [com.mycompany.myapp:myapp-lambda-read-api::jar, com.mycompany.myapp:myapp-sse-client::jar]
- "com.mycompany.myapp.sse.service.impl" found in [com.mycompany.myapp:myapp-lambda-read-api::jar, com.mycompany.myapp:myapp-sse-client::jar]
72161 [INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /tmp/myapp/myapp-lambda/myapp-lambda-read-api/target/myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-native-image-source-jar/myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner.jar
72779 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /tmp/myapp/myapp-lambda/myapp-lambda-read-api/target/myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-native-image-source-jar/myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner.jar
72885 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM 22.3.2 Java 17 CE (Java Version 17.0.7+7-jvmci-22.3-b18)
72889 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /opt/graalvm/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+CollectImageBuildStatistics -H:ImageBuildStatisticsFile=myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner-timing-stats.json -H:BuildOutputJSONFile=myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner-build-output-stats.json -H:+AllowFoldMethods -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+ReportExceptionStackTraces -H:-AddAllCharsets --enable-url-protocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace -J--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner -jar myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'myapp-lambda-read-api-1.0-1ff883a-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                   (11.9s @ 0.33GB)
 Version info: 'GraalVM 22.3.2 Java 17 CE'
 Java version info: '17.0.7+7-jvmci-22.3-b18'
 C compiler: gcc (linux, x86_64, 10.2.1)
 Garbage collector: Serial GC
 2 user-specific feature(s)
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
[2/7] Performing analysis...  [*]                                                                       (69.4s @ 3.60GB)
  15,038 (88.66%) of 16,962 classes reachable
  20,595 (57.46%) of 35,840 fields reachable
  70,993 (51.70%) of 137,320 methods reachable
     600 classes,   965 fields, and 4,961 methods registered for reflection
2 fatal errors detected:
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient$AttachHttpAttributesExecutionInterceptor.afterMarshalling(software.amazon.awssdk.core.interceptor.Context$AfterMarshalling, software.amazon.awssdk.core.interceptor.ExecutionAttributes) 
Parsing context:
   at software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient$AttachHttpAttributesExecutionInterceptor.afterMarshalling(DefaultS3CrtAsyncClient.java:287)
   at software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.lambda$afterMarshalling$4(ExecutionInterceptorChain.java:81)
   at software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain$$Lambda$2153/0x00000007c1b3ab60.accept(Unknown Source)
   at java.lang.Iterable.forEach(Iterable.java:75)
   at java.util.regex.Pattern.normalizeSlice(Pattern.java:1522)
   at java.util.regex.Pattern.normalize(Pattern.java:1481)
   at java.util.regex.Pattern.compile(Pattern.java:1745)
   at java.util.regex.Pattern.matcher(Pattern.java:1131)
   at java.util.Formatter.parse(Formatter.java:2742)
   at java.util.Formatter.format(Formatter.java:2671)
   at java.util.Formatter.format(Formatter.java:2625)
   at java.lang.String.format(String.java:4141)
   at jdk.internal.util.Preconditions.outOfBoundsMessage(Preconditions.java:209)
   at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
   at jdk.internal.util.Preconditions.outOfBoundsCheckFromIndexSize(Preconditions.java:82)
   at jdk.internal.util.Preconditions.checkFromIndexSize(Preconditions.java:361)
   at java.util.Objects.checkFromIndexSize(Objects.java:413)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultVirtualInvokeTypeFlow.java:109)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:562)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: software.amazon.awssdk.crt.s3.ResumeToken. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line
	at parsing software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:38)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.fieldfolding.StaticFinalFieldFoldingNodePlugin.handleLoadStaticField(StaticFinalFieldFoldingFeature.java:358)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4801)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4772)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5282)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:171)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
	... 13 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: software.amazon.awssdk.crt.s3.ResumeToken. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedLoadConstant(SharedGraphBuilderPhase.java:259)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genLoadConstant(BytecodeParser.java:3945)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5124)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
	... 45 more
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>() 
Parsing context: <no parsing context available> 
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultAnalysisPolicy.staticRootMethodGraph(DefaultAnalysisPolicy.java:182)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis.lambda$addRootMethod$0(PointsToAnalysis.java:320)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$2.run(PointsToAnalysis.java:507)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.oracle.graal.pointsto.util.AnalysisError: parsing had failed in another thread
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.shouldNotReachHere(AnalysisError.java:177)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:720)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:171)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
	... 13 more
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: software.amazon.awssdk.crt.s3.ResumeToken. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line
	at parsing software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:38)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.fieldfolding.StaticFinalFieldFoldingNodePlugin.handleLoadStaticField(StaticFinalFieldFoldingFeature.java:358)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4801)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4772)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5282)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:171)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultVirtualInvokeTypeFlow.java:109)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:562)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
	... 8 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: software.amazon.awssdk.crt.s3.ResumeToken. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedLoadConstant(SharedGraphBuilderPhase.java:259)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genLoadConstant(BytecodeParser.java:3945)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5124)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
	... 45 more

Can you tell me where I am wrong?

@scrocquesel
Copy link
Member Author

@gquintana Did you exclude explicitely software.amazon.awssdk.crt:aws-crt ?
Could you provide a reproducer based on https://github.com/quarkusio/quarkus-quickstarts/tree/main/amazon-s3-quickstart ?

@scrocquesel
Copy link
Member Author

@gquintana Did you exclude explicitely software.amazon.awssdk.crt:aws-crt ? Could you provide a reproducer based on https://github.com/quarkusio/quarkus-quickstarts/tree/main/amazon-s3-quickstart ?

Repro with

<dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-s3</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>software.amazon.awssdk.crt</groupId>
                    <artifactId>aws-crt</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

@gquintana
Copy link

gquintana commented Jul 26, 2023

@gquintana Did you exclude explicitely software.amazon.awssdk.crt:aws-crt ?

Nope. But quarkus-amazon-s3 does not pull aws-crt (only crt-core)

[INFO] +- io.quarkiverse.amazonservices:quarkus-amazon-s3:jar:2.4.1:compile
[INFO] |  +- io.quarkus:quarkus-arc:jar:3.2.2.Final:compile
[INFO] |  |  +- io.quarkus.arc:arc:jar:3.2.2.Final:compile
[INFO] |  |  |  \- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile
[INFO] |  |  \- org.eclipse.microprofile.context-propagation:microprofile-context-propagation-api:jar:1.3:compile
[INFO] |  +- io.quarkiverse.amazonservices:quarkus-amazon-common:jar:2.4.1:compile
[INFO] |  |  +- software.amazon.awssdk:sdk-core:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:aws-core:jar:2.20.103:compile
[INFO] |  |  |  \- software.amazon.eventstream:eventstream:jar:1.0.1:compile
[INFO] |  |  +- software.amazon.awssdk:regions:jar:2.20.103:compile
[INFO] |  |  \- software.amazon.awssdk:auth:jar:2.20.103:compile
[INFO] |  +- software.amazon.awssdk:s3:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:aws-xml-protocol:jar:2.20.103:compile
[INFO] |  |  |  \- software.amazon.awssdk:aws-query-protocol:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:protocol-core:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:arns:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:profiles:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:crt-core:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:metrics-spi:jar:2.20.103:compile
[INFO] |  |  +- software.amazon.awssdk:json-utils:jar:2.20.103:compile
[INFO] |  |  |  \- software.amazon.awssdk:third-party-jackson-core:jar:2.20.103:compile
[INFO] |  |  \- software.amazon.awssdk:endpoints-spi:jar:2.20.103:compile
[INFO] |  \- org.jboss.logging:commons-logging-jboss-logging:jar:1.0.0.Final:compile

I confirm your fix #858 works for us

@gquintana
Copy link

@scrocquesel Here is the reproducer quarkusio/quarkus-quickstarts@main...gquintana:quarkus-quickstarts:repro-gh-857
I just removed the S3AsyncClientResource class along with the netty-nio-client dependency

@scrocquesel
Copy link
Member Author

@gquintana 2.4.2 is available.

@gquintana
Copy link

gquintana commented Jul 28, 2023

@scrocquesel I have just integrated 2.4.2, and I have different problem now:

[1/7] Initializing...                                                                                   (17.5s @ 0.35GB)
 Version info: 'GraalVM 22.3.2 Java 17 CE'
 Java version info: '17.0.7+7-jvmci-22.3-b18'
 C compiler: gcc (linux, x86_64, 10.2.1)
 Garbage collector: Serial GC
 2 user-specific feature(s)
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
[2/7] Performing analysis...  []                                                                        (78.8s @ 2.47GB)
  14,093 (93.35%) of 15,097 classes reachable
  19,633 (57.20%) of 34,324 fields reachable
  68,473 (81.50%) of 84,014 methods reachable
     675 classes,     0 fields, and     0 methods registered for reflection
Error: Unsupported type software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
com.oracle.svm.core.util.UserError$UserException: Unsupported type software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:776)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:578)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported type software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.lookup(AnnotationSubstitutionProcessor.java:148)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:125)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:125)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:210)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:190)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:75)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess$1.apply(UniverseMetaAccess.java:52)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess$1.apply(UniverseMetaAccess.java:49)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess.lookupJavaType(UniverseMetaAccess.java:84)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMetaAccess.lookupJavaType(AnalysisMetaAccess.java:52)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.processClass(ReflectionDataBuilder.java:724)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.processRegisteredElements(ReflectionDataBuilder.java:691)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.duringAnalysis(ReflectionDataBuilder.java:196)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionFeature.duringAnalysis(ReflectionFeature.java:254)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:748)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$11(NativeImageGenerator.java:748)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:162)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:745)
	... 5 more

I am sorry

@scrocquesel scrocquesel reopened this Jul 28, 2023
@scrocquesel
Copy link
Member Author

Is it reproductible with the quick start ?
I'd like to find a way so that the CRT lib is optional with quarkus S3 as it is the case with the bare aws S3 lib.

@gquintana
Copy link

I'll do some more testing but seems to be related to GraalVM:

  • Java version: 17.0.7+7, vendor version: Mandrel-23.0.0.0-Final ✔
  • Version info: 'GraalVM 22.3.2 Java 17 CE' Java version info: '17.0.7+7-jvmci-22.3-b18' ❌

@scrocquesel
Copy link
Member Author

I'll do some more testing but seems to be related to GraalVM:

  • Java version: 17.0.7+7, vendor version: Mandrel-23.0.0.0-Final ✔
  • Version info: 'GraalVM 22.3.2 Java 17 CE' Java version info: '17.0.7+7-jvmci-22.3-b18' ❌

Thanks for the info

@gquintana
Copy link

gquintana commented Jul 29, 2023

I can not reproduce it locally, it occurs only Gitlab CI runner, I need to find what the real difference is.

  • Java version: 17.0.8+7, vendor version: GraalVM CE 17.0.8+7.1 ✔

@scrocquesel
Copy link
Member Author

If you use -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=graalvm to build, Quarkus will use quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-17 which is not bound to a particular version of GraalVM and the image have just been updated to native-image 17.0.8. Your CI runner may have cached the docker image with 17.0.7.

The default mandrel flavor uses quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17 which has also recently been updated to 23.0.1.

I tested both and it passed.

@argenstijn
Copy link

argenstijn commented Sep 1, 2023

Same problem here when i use quarkus 3.3.1 and a higher version then 2.3.2.

With version 2.3.2 is working

@scrocquesel
Copy link
Member Author

scrocquesel commented Sep 2, 2023

Same problem here when i use quarkus 3.3.1 and a higher version then 2.3.2.

With version 2.3.2 is working

Should not make a difference but Quarkus 3.3.x should be aligned with 2.5.x. I just tested with those version (3.3.1/2.5.0) and it passed.

OpenJDK Runtime Environment Mandrel-23.0.1.2-Final (build 17.0.8+7)
OpenJDK 64-Bit Server VM Mandrel-23.0.1.2-Final (build 17.0.8+7, mixed mode) 
Java version: 17.0.8+7, vendor version: Mandrel-23.0.1.2-Final

@argenstijn which version of native-image do you use ?

@argenstijn
Copy link

@scrocquesel

Below my specs:

docker of native image: quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3.3-java17
maven 3.9.4

Ps. it works when i add the dependency below:

  <dependency>
      <groupId>software.amazon.awssdk.crt</groupId>
      <artifactId>aws-crt</artifactId>
    </dependency>

Below all my dependencies:

`

io.quarkus
quarkus-amazon-lambda

<dependency>
  <groupId>io.quarkiverse.amazonservices</groupId>
  <artifactId>quarkus-amazon-ssm</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkiverse.amazonservices</groupId>
  <artifactId>quarkus-amazon-s3</artifactId>
</dependency>

<dependency>
  <groupId>software.amazon.awssdk</groupId>
  <artifactId>url-connection-client</artifactId>
</dependency>

<dependency>
  <groupId>software.amazon.awssdk.crt</groupId>
  <artifactId>aws-crt</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-logging-json</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-jdbc-db2</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-agroal</artifactId>
</dependency>`

@antonwiens
Copy link

I have the same problem with building a native image. But the error is now different with version 2.4.5:

Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: software.amazon.awssdk.crt.s3.ResumeToken. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:521)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:515)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:407)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedLoadConstant(SharedGraphBuilderPhase.java:318)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genLoadConstant(BytecodeParser.java:3967)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5167)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3406)
	... 52 more

I guess this happens because a CRT class
software.amazon.awssdk.crt.s3.ResumeToken
is referenced in
software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute
which is not provided during native build.

I guess a fix would be removing the CRT_PAUSE_RESUME_TOKEN static field if CRT dependencies are not in the classpath.

@gquintana
Copy link

gquintana commented Sep 4, 2023

From my testing with quarkus amazon services 2.4.1-2.4.3 and native compilation, there are 2 solutions:

  • Add the aws-crt-client dependency even if you don't use it
  • Upgrade from GraalVM 22.3 to GraalVM for JDK 17 (or more)

I don't have any problem since I upgraded to Mandrel 23

@scrocquesel
Copy link
Member Author

You should be using GraalVM 23.0.0 with Quarkus 3.2.

With 3.2.5.Final / 2.4.5, if you do

./mvnw clean package -Dquarkus.package.type=native-sources -Dquarkus.native.container-build=true -DskipTests
cat target/native-sources/graalvm.version && echo
cat target/native-sources/native-builder.image  && echo
echo --
docker run --rm $(cat target/native-sources/native-builder.image) native-image --version

You'll get

23.0.0
quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17
--
native-image 17.0.8 2023-07-18
OpenJDK Runtime Environment Mandrel-23.0.1.2-Final (build 17.0.8+7)
OpenJDK 64-Bit Server VM Mandrel-23.0.1.2-Final (build 17.0.8+7, mixed mode)

I'll recommend reading https://quarkus.io/guides/building-native-image#separating-java-and-native-image-compilation if you want some tips to keep up to date with the recommended graalvm version and docker image. native-builder.image file was added so that its value can be exported as env var in a ci pipeline to be use as runner image for subsequent native build job when docker in docker is not an option.

@scrocquesel
Copy link
Member Author

Closing as it should work with the correct version of graalvm. Reopen if you still have some issue.

@trico-tillster
Copy link

Hello, bringing back this issue.
I recently moved to java 21 and quarkus 3.15.1 with aws sdk 2.28.24.
For creating native image I'm using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21

Java version: 21.0.5+11-LTS, vendor version: Mandrel-23.1.5.0-Final
Graal compiler: optimization level: 2, target machine: x86-64-v3
C compiler: gcc (redhat, x86_64, 8.5.0)
Garbage collector: Serial GC (max heap size: 80% of RAM) 

And when creating a native image I'm still facing this error:

Caused by: com.oracle.svm.core.util.UserError$UserException: Class initialization of software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute failed. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line and command line. Use the option 

    '--initialize-at-run-time=software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute'

 to explicitly request initialization of this class at run time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:187)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:191)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:129)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:161)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:150)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.onTypeReachable(SVMHost.java:310)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.onTypeReachable(AnalysisUniverse.java:699)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.lambda$new$0(AnalysisType.java:310)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 46 more
Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/crt/s3/ResumeToken
	at software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:37)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
	... 55 more

I track this to be related with this issue and the way I could solve it was by adding the aws-crt dependency to the project.
Any hints how to solve this without adding the dependency?
Thank you

@scrocquesel
Copy link
Member Author

Hello, bringing back this issue. I recently moved to java 21 and quarkus 3.15.1 with aws sdk 2.28.24. For creating native image I'm using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21

Java version: 21.0.5+11-LTS, vendor version: Mandrel-23.1.5.0-Final
Graal compiler: optimization level: 2, target machine: x86-64-v3
C compiler: gcc (redhat, x86_64, 8.5.0)
Garbage collector: Serial GC (max heap size: 80% of RAM) 

And when creating a native image I'm still facing this error:

Caused by: com.oracle.svm.core.util.UserError$UserException: Class initialization of software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute failed. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line and command line. Use the option 

    '--initialize-at-run-time=software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute'

 to explicitly request initialization of this class at run time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:187)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:191)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:129)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:161)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:150)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.onTypeReachable(SVMHost.java:310)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.onTypeReachable(AnalysisUniverse.java:699)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.lambda$new$0(AnalysisType.java:310)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 46 more
Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/crt/s3/ResumeToken
	at software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:37)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
	... 55 more

I track this to be related with this issue and the way I could solve it was by adding the aws-crt dependency to the project. Any hints how to solve this without adding the dependency? Thank you

@trico-tillster Please open a new issue with your pom.xml and application.properties and if you can a small reproducer. We don't explicitely add S3InternalSdkHttpExecutionAttribute to initialize-at-run-time so something else is adding it. In addition this class is used only by DefaultS3CrtAsyncClient which is removed by a graalvm substitution provided by quarkus-amazon-s3.

@nigelspowage
Copy link

Hello, bringing back this issue. I recently moved to java 21 and quarkus 3.15.1 with aws sdk 2.28.24. For creating native image I'm using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21

Java version: 21.0.5+11-LTS, vendor version: Mandrel-23.1.5.0-Final
Graal compiler: optimization level: 2, target machine: x86-64-v3
C compiler: gcc (redhat, x86_64, 8.5.0)
Garbage collector: Serial GC (max heap size: 80% of RAM) 

And when creating a native image I'm still facing this error:

Caused by: com.oracle.svm.core.util.UserError$UserException: Class initialization of software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute failed. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line and command line. Use the option 

    '--initialize-at-run-time=software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute'

 to explicitly request initialization of this class at run time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:187)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:191)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:129)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:161)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:150)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.onTypeReachable(SVMHost.java:310)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.onTypeReachable(AnalysisUniverse.java:699)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.lambda$new$0(AnalysisType.java:310)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 46 more
Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/crt/s3/ResumeToken
	at software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:37)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
	... 55 more

I track this to be related with this issue and the way I could solve it was by adding the aws-crt dependency to the project. Any hints how to solve this without adding the dependency? Thank you

@trico-tillster Please open a new issue with your pom.xml and application.properties and if you can a small reproducer. We don't explicitely add S3InternalSdkHttpExecutionAttribute to initialize-at-run-time so something else is adding it. In addition this class is used only by DefaultS3CrtAsyncClient which is removed by a graalvm substitution provided by quarkus-amazon-s3.

@trico-tillster did you work out what caused this ? I'm seeing the exact same error message and haven't worked out what the underlying cause is. I can work around this by adding the same dependency but that's not ideal for me and I'd rather avoid that.

@scrocquesel
Copy link
Member Author

Hello, bringing back this issue. I recently moved to java 21 and quarkus 3.15.1 with aws sdk 2.28.24. For creating native image I'm using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21

Java version: 21.0.5+11-LTS, vendor version: Mandrel-23.1.5.0-Final
Graal compiler: optimization level: 2, target machine: x86-64-v3
C compiler: gcc (redhat, x86_64, 8.5.0)
Garbage collector: Serial GC (max heap size: 80% of RAM) 

And when creating a native image I'm still facing this error:

Caused by: com.oracle.svm.core.util.UserError$UserException: Class initialization of software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute failed. This error is reported at image build time because class software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute is registered for linking at image build time by command line and command line. Use the option 

    '--initialize-at-run-time=software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute'

 to explicitly request initialization of this class at run time.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:187)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:191)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:129)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:161)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:150)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.onTypeReachable(SVMHost.java:310)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.onTypeReachable(AnalysisUniverse.java:699)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.lambda$new$0(AnalysisType.java:310)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 46 more
Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/crt/s3/ResumeToken
	at software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute.<clinit>(S3InternalSdkHttpExecutionAttribute.java:37)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
	... 55 more

I track this to be related with this issue and the way I could solve it was by adding the aws-crt dependency to the project. Any hints how to solve this without adding the dependency? Thank you

@trico-tillster Please open a new issue with your pom.xml and application.properties and if you can a small reproducer. We don't explicitely add S3InternalSdkHttpExecutionAttribute to initialize-at-run-time so something else is adding it. In addition this class is used only by DefaultS3CrtAsyncClient which is removed by a graalvm substitution provided by quarkus-amazon-s3.

@trico-tillster did you work out what caused this ? I'm seeing the exact same error message and haven't worked out what the underlying cause is. I can work around this by adding the same dependency but that's not ideal for me and I'd rather avoid that.

@nigelspowage Could you provide a small repro ?

@scrocquesel scrocquesel reopened this Nov 28, 2024
@nigelspowage
Copy link

nigelspowage commented Nov 29, 2024

@scrocquesel I think I'm going to struggle to create a small repo of this as I'm seeing this as part of a pretty large project.

If it helps at all my pom.xml includes the following:

<properties>
    ...
    <quarkus.version>3.16.1</quarkus.version>
    <quarkus-amazon-services.version>2.20.1</quarkus-amazon-services.version>
</properties>

<dependencyManagement>
    ...
    <dependencies>
        ...
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${quarkus.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus.platform</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${quarkus.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-services-bom</artifactId>
            <version>${quarkus-amazon-services.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>io.quarkiverse.amazonservices</groupId>
        <artifactId>quarkus-amazon-common</artifactId>
    </dependency>
</dependencies>

Noting on your prior comment that

this class is used only by DefaultS3CrtAsyncClient which is removed by a graalvm substitution provided by quarkus-amazon-s3

I added the following dependency

<dependency>
    <groupId>io.quarkiverse.amazonservices</groupId>
    <artifactId>quarkus-amazon-s3</artifactId>
</dependency>

and this removed the error.

However, I'm now seeing the following error when building a graal native build.

Fatal error: java.lang.NoClassDefFoundError: io/netty/handler/ssl/SslProvider
        at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3650)
        at java.base/java.lang.Class.getDeclaredMethods(Class.java:2735)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$registerAllDeclaredMethodsQuery$20(ReflectionDataBuilder.java:379)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$runConditionalInAnalysisTask$2(ReflectionDataBuilder.java:184)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1717)
        at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1458)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2034)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
Caused by: java.lang.ClassNotFoundException: io.netty.handler.ssl.SslProvider
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:637)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
        ... 14 more

I would be grateful if this gives you any clues or hints to what might be wrong.

@scrocquesel
Copy link
Member Author

Do you have any AWS SDK artifact in your pom XML ?

@scrocquesel
Copy link
Member Author

You should only use quarkus bom or quarkus platform bom but not both. See the main readme for when to use or the other.

@nigelspowage
Copy link

Thanks, I thought I'd read the main readme but I must have missed that bit. I'll check it again.

Yes to AWS SDK artifacts.

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>s3</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>netty-nio-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>apache-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>secretsmanager</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>netty-nio-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>apache-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>sqs</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>netty-nio-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>apache-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
                <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>url-connection-client</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>aws-core</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>sdk-core</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>auth</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>regions</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>http-client-spi</artifactId>
        </dependency>

@scrocquesel
Copy link
Member Author

scrocquesel commented Nov 29, 2024

Thanks, I thought I'd read the main readme but I must have missed that bit. I'll check it again.

Yes to AWS SDK artifacts.

A few questions. Why are you adding so many aws dependencies ?
The pattern is to add io.quarkiverse.amazonservices:quarkus-amazon-* dependency instead of software.amazon.awssdk:*. Then you choose the http client implementation and you add the appropriate software.amazon.awssdk:*-client. If not the default one, you configure the type in application.properties.
I guess you are using synchronuous client with url-connection which is the default.

So in your case, regarding aws sdk, your pom should be as simple as

<properties>
    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
    <quarkus.platform.version>3.17.2</quarkus.platform.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>quarkus-amazon-services-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
        <groupId>io.quarkiverse.amazonservices</groupId>
        <artifactId>quarkus-amazon-s3</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkiverse.amazonservices</groupId>
        <artifactId>quarkus-amazon-secretsmanager</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkiverse.amazonservices</groupId>
        <artifactId>quarkus-amazon-sqs</artifactId>
    </dependency>
    <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>url-connection-client</artifactId>
    </dependency>
  </dependencies>

In such a case your are not importing netty from aws sdk, nor using it. Are you building the native image with a local installation of graalvm ? Which version ? It would help if I can reproduce. I guess GraalVM is reaching this code

asyncConfig.sslProvider().map(SslProviderType::create).ifPresent(builder::sslProvider);

But it should be the case only, if you are injecting an AsyncClient and you are not using the CRT async http client implementation. In this case, netty client implementation is used and as it is not in the dependency list, build should fail earlier with "Missing 'software.amazon.awssdk:netty-nio-client' dependency on the classpath

@nigelspowage
Copy link

Hi, thanks for your response. In answer to your questions:

Why are you adding so many aws dependencies ?
The pattern is to add io.quarkiverse.amazonservices:quarkus-amazon-* dependency instead of software.amazon.awssdk:*

There are project rules in place that require all dependencies to be specified and not to use wildcards. It's not something I can change for this project so it makes the pom.xml files quite wordy.

I guess you are using synchronuous client with url-connection which is the default.

Yes, I'm using url-connection-client.

Are you building the native image with a local installation of graalvm ? Which version ?

I'm building using the container image build via maven, using the following settings:

<properties>
   <quarkus.native.enabled>true</quarkus.native.enabled>
   <quarkus.native.container-build>true</quarkus.native.container-build>
   <quarkus.native.container-runtime>docker</quarkus.native.container-runtime>
   <quarkus.native.builder-image>ers-quarkus-build-multiarch:latest</quarkus.native.builder-image>
   <quarkus.native.remote-container-build>true</quarkus.native.remote-container-build>
</properties>

The output when compiling is as follows:

 Java version: 23.0.1+11, vendor version: GraalVM CE 23.0.1+11.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 6 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Adapts logging during the analysis phase
 - org.eclipse.angus.activation.nativeimage.AngusActivationFeature
 - org.springframework.aot.nativex.feature.PreComputeFieldFeature
------------------------------------------------------------------------------------------------------------------------
 4 experimental option(s) unlocked:
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:+GenerateBuildArtifactsFile' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------

I have removed the reference to the quarkus bom leaving the quarkus platform bom, and added the quarkiverse dependencies you've noted but the same netty dependency error still occurs on the native build.

@scrocquesel
Copy link
Member Author

Hi, thanks for your response. In answer to your questions:

Why are you adding so many aws dependencies ?
The pattern is to add io.quarkiverse.amazonservices:quarkus-amazon-* dependency instead of software.amazon.awssdk:*

There are project rules in place that require all dependencies to be specified and not to use wildcards. It's not something I can change for this project so it makes the pom.xml files quite wordy.

I guess you are using synchronuous client with url-connection which is the default.

Yes, I'm using url-connection-client.

Are you building the native image with a local installation of graalvm ? Which version ?

I'm building using the container image build via maven, using the following settings:

<properties>
   <quarkus.native.enabled>true</quarkus.native.enabled>
   <quarkus.native.container-build>true</quarkus.native.container-build>
   <quarkus.native.container-runtime>docker</quarkus.native.container-runtime>
   <quarkus.native.builder-image>ers-quarkus-build-multiarch:latest</quarkus.native.builder-image>
   <quarkus.native.remote-container-build>true</quarkus.native.remote-container-build>
</properties>

The output when compiling is as follows:

 Java version: 23.0.1+11, vendor version: GraalVM CE 23.0.1+11.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 6 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Adapts logging during the analysis phase
 - org.eclipse.angus.activation.nativeimage.AngusActivationFeature
 - org.springframework.aot.nativex.feature.PreComputeFieldFeature
------------------------------------------------------------------------------------------------------------------------
 4 experimental option(s) unlocked:
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:+GenerateBuildArtifactsFile' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------

I have removed the reference to the quarkus bom leaving the quarkus platform bom, and added the quarkiverse dependencies you've noted but the same netty dependency error still occurs on the native build.

Attach the full native build log.
I tried to build a cli project without Netty at all and it passed. Still trying to figure out what make GraalVM to reach this part of the code

@nigelspowage
Copy link

build.log
Hopefully this gives you the info you need. Let me know if you need more detail.

@scrocquesel
Copy link
Member Author

Reference

build.log Hopefully this gives you the info you need. Let me know if you need more detail.

build.log Hopefully this gives you the info you need. Let me know if you need more detail.

Unfortunately not. I suspect one of the other extension you use to instrospect every types. Nonetheless, I'm working on a big refactor that should help in this case.

@scrocquesel scrocquesel self-assigned this Dec 9, 2024
@scrocquesel scrocquesel added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants