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

Native Image Compilation Stack Trace Not Showing Underlying Error related to --initialize-at-run-time using Gradle #9306

Closed
murphye opened this issue May 14, 2020 · 15 comments
Labels
area/gradle Gradle kind/bug Something isn't working
Milestone

Comments

@murphye
Copy link

murphye commented May 14, 2020

Describe the bug

This is using Gradle quarkusBuild, but may be present in Maven as well.

I am working with a team at AWS to get their Deep Java Learning (DJL) library working in Quarkus native. I ran into a native compilation error.

Here is the strack trace from the error:
deepjavalibrary/djl#67 (comment)

Expected behavior

The stack trace should state what the underlying error is that is elevated by using --initialize-at-run-time.

Actual behavior

Stack trace has no real error message.

To Reproduce

Reproducer coming.

@quarkusbot
Copy link

/cc @quarkusio/devtools

@quarkusbot quarkusbot added the area/gradle Gradle label May 14, 2020
@stu1130
Copy link

stu1130 commented May 14, 2020

  1. I added --initialize-at-run-time in the application.properties. I assumed it would make all of classes being initialized at runtime.
# Configuration file
# key = value
quarkus.native.enable-jni=true
quarkus.ssl.native=true
quarkus.native.additional-build-args=-H:ResourceConfigurationFiles=resources-config.json,\
  --initialize-at-run-time
quarkus.log.level=DEBUG
quarkus.log.category."org.hibernate".level=DEBUG

with ./gradlew build -Dquarkus.package.type=native -x test -S

> Task :quarkusBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:353)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
  Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:339)
        ... 12 more


* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':quarkusBuild'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:353)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:339)
        ... 12 more

        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:247)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createProductionApplication(AugmentActionImpl.java:87)
        at io.quarkus.gradle.tasks.QuarkusBuild.buildQuarkus(QuarkusBuild.java:79)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:727)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:694)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
        ... 33 more
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:353)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:339)
        ... 12 more

        at io.quarkus.builder.Execution.run(Execution.java:115)
        at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:156)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:245)
        ... 104 more
Caused by: java.lang.RuntimeException: Failed to build native image
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:353)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:339)
        ... 12 more


* Get more help at https://help.gradle.org

BUILD FAILED in 7s

with ./gradlew build -Dquarkus.package.type=native -x test -d
output.log

@murphye
Copy link
Author

murphye commented May 14, 2020

Just to note, having --initialize-at-run-time with no class list is not correct. That being said, an error should state this.

We need to find out, what error comes from GraalVM and is it propagated through Gradle quarkusBuild correctly?

@geoand
Copy link
Contributor

geoand commented May 21, 2020

So if I understand this correctly, this is about the output from GraalVM not showing up in the logged error?

@murphye
Copy link
Author

murphye commented May 24, 2020

@geoand That seems to be the case... I am wondering if this a Gradle issue where it's not showing all of the errors coming from native image

@provCristianMaluenda
Copy link

I am facing the same issue trying to use AWS Secrets Manager SDK. Gradle doesn't show any useful info in the logs.
Since I start to use Quarkus, always I have had the same problem.
I am using:

  • Gradle 6.2.2
  • Quarkus 1.4.2.Final
  • GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)

@murphye
Copy link
Author

murphye commented Jun 16, 2020

Potential related:

#2414 (comment)
oracle/graal#2241

@jaikiran
Copy link
Member

I am facing the same issue trying to use AWS Secrets Manager SDK. Gradle doesn't show any useful info in the logs.
Since I start to use Quarkus, always I have had the same problem.
I am using:

* Gradle 6.2.2

* Quarkus 1.4.2.Final

* GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)

@provCristianMaluenda, is there an reproducer application you can share (perhaps as a github repo)?

@jaikiran
Copy link
Member

jaikiran commented Jun 19, 2020

I have never used Gradle before, but I have recently seen many users complaining about the lack of log messages (especially) when building native images with Quarkus. So I decided to take a look at this. To be honest, I am really surprised by the complete lack of logs that show up during a normal gradle build process of Quarkus application as compared to Maven, which prints out useful log messages during the same application build. To give others an idea, during native-image generation of a Quarkus application using Maven, we are used to seeing helpful messages like:

[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]        (cap):   2,147.75 ms,  0.94 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]        setup:   4,427.79 ms,  0.94 GB
17:27:50,236 INFO  [org.jbo.threads] JBoss Threads version 3.1.1.Final
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]     (clinit):     725.16 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]   (typeflow):  14,309.93 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]    (objects):  14,660.82 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]   (features):     636.42 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]     analysis:  31,663.79 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]     universe:   1,404.90 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]      (parse):   3,699.44 ms,  2.80 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]     (inline):  10,452.02 ms,  3.50 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]    (compile):  36,515.61 ms,  4.56 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]      compile:  53,489.95 ms,  4.56 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]        image:   4,579.45 ms,  4.63 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]        write:   2,070.25 ms,  4.63 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:91144]      [total]: 291,590.58 ms,  4.63 GB

To my surprise, none of this shows up in Gradle builds. It's like watching a blank console which shows a progress bar without any of these details.

So I looked into the Gradle code a bit more (well it turned out to be a mammoth exercise with all the logging wrappers/delegates/listeners/libraries spaghetti that we are used to seeing in the Java logging world :)). I ultimately found 2-3 issues that are stopping us from having a more informative build process for a Quarkus application. One such issue is within the Gradle tool itself which I have logged here gradle/gradle#13522. The other two issues have to do with certain configurations which I think we (Quarkus) can improve ourselves for the Gradle builds. I'll open a separate issue or a PR within this Quarkus repo for that, later.

As for whether or not the fix for gradle/gradle#13522 will show up the real root cause of the native image generation failures in this issue, we can verify it by running it against a patched version of Gradle with the fix I've in mind. If one of you is interested in testing this fix, I'll share a Gradle forked repo which perhaps you can build yourself and use it to test against Quarkus app? Or maybe one of you can share an application (as a github repo) which reproduces this issue (preferably against 1.5.2.Final series of Quarkus) and I'll run it locally when I get a chance.

@jaikiran
Copy link
Member

#10137 has been merged in Quarkus. This should provide a bit more visibility in the native image build process in Quarkus when using Gradle. A few more enhancements will be needed to have this build process be almost on par with Maven when it comes to logging. I will get to those when I get a chance.

@provCristianMaluenda
Copy link

provCristianMaluenda commented Jun 22, 2020

I am facing the same issue trying to use AWS Secrets Manager SDK. Gradle doesn't show any useful info in the logs.
Since I start to use Quarkus, always I have had the same problem.
I am using:

* Gradle 6.2.2

* Quarkus 1.4.2.Final

* GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)

@provCristianMaluenda, is there an reproducer application you can share (perhaps as a github repo)?

Sorry @jaikiran, I missed your comment. I have a private project that I can not share, but I could create a new project for this issue if still you need it.
Thanks for your help!

@jaikiran
Copy link
Member

I have a privet project that I can not share, but I could create a new project for this issue if still you need it.

Yes please. That will help us figure out what else will help to debug issues like these on Gradle.

@provCristianMaluenda
Copy link

I have a privet project that I can not share, but I could create a new project for this issue if still you need it.

Yes please. That will help us figure out what else will help to debug issues like these on Gradle.

@jaikiran I have a project with issues to build the native image for you here:
https://github.com/provcristianmaluenda/graal

The GraalVM that I am using is:

openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02, mixed mode, sharing)

I hope this helps!

Thanks

@jaikiran
Copy link
Member

@provCristianMaluenda, thank you for that app. It helped. I gave it a try against the latest upstream of Quarkus (which has this fix #10137) and built your app in native mode. The build now clearly reports what went wrong:

Starting a Gradle Daemon, 4 busy and 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE

> Task :quarkusBuild
building quarkus runner

-H:IncludeAllTimeZones and -H:IncludeTimeZones are now deprecated. Native-image includes all timezonesby default.
[test-0.0.33-runner:51789]    classlist:  19,456.72 ms,  1.17 GB
[test-0.0.33-runner:51789]        (cap):   3,905.16 ms,  1.17 GB
[test-0.0.33-runner:51789]        setup:   8,516.54 ms,  1.17 GB
07:34:48,070 INFO  [org.gra.fai.ser.api.CredentialProvider] Credentials provider: AWSCredentialsClient [us-west-2]
07:35:29,868 INFO  [org.jbo.threads] JBoss Threads version 3.1.1.Final
[test-0.0.33-runner:51789]     (clinit):   1,485.48 ms,  5.14 GB
[test-0.0.33-runner:51789]   (typeflow):  44,930.51 ms,  5.14 GB
[test-0.0.33-runner:51789]    (objects):  42,565.12 ms,  5.14 GB
[test-0.0.33-runner:51789]   (features):   1,560.69 ms,  5.14 GB
[test-0.0.33-runner:51789]     analysis:  94,248.87 ms,  5.14 GB
Error: Unsupported features in 2 methods
Detailed message:
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.ThreadPoolExecutor$Worker.thread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.locks.AbstractOwnableSynchronizer.exclusiveOwnerThread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)

com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.ThreadPoolExecutor$Worker.thread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.locks.AbstractOwnableSynchronizer.exclusiveOwnerThread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)

	at com.oracle.svm.core.util.UserError.abort(UserError.java:79)
	at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:217)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:753)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:538)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:451)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.ThreadPoolExecutor$Worker.thread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time.  To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by 
	reading field java.util.concurrent.locks.AbstractOwnableSynchronizer.exclusiveOwnerThread of
		constant java.util.concurrent.ThreadPoolExecutor$Worker@23e3ab45 reached by 
	reading field java.util.HashMap$Node.key of
		constant java.util.HashMap$Node@46635ad2 reached by 
	indexing into array
		constant java.util.HashMap$Node[]@4d9b8a04 reached by 
	reading field java.util.HashMap.table of
		constant java.util.HashMap@46635ad2 reached by 
	reading field java.util.HashSet.map of
		constant java.util.HashSet@23e3ab45 reached by 
	reading field java.util.concurrent.ThreadPoolExecutor.workers of
		constant java.util.concurrent.ThreadPoolExecutor@31e237e9 reached by 
	reading field java.util.concurrent.Executors$DelegatedExecutorService.e of
		constant java.util.concurrent.Executors$FinalizableDelegatedExecutorService@5f94495e reached by 
	reading field software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.exec of
		constant software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper@53ae3c06 reached by 
	scanning method software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
Call path from entry point to software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(): 
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper.getInstance(IdleConnectionReaper.java:106)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:150)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:119)
	at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:98)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:553)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
	at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder$$Lambda$868/0x00000007c1aa4040.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)

	at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:750)
	... 8 more
Error: Image build request failed with exit status 1

> Task :quarkusBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
  	[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:361)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
  	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
  	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
  	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
  	at java.base/java.lang.Thread.run(Thread.java:834)
  	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
  Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:411)
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:347)
  	... 12 more

I tried it against 1.5.1.Final of Quarkus, just to be sure. Against it, no matter what configs you use, these errors don't get reported and only the final build failure message with the "Image generation failed" message appears.

So the upcoming release of 1.6 of Quarkus which should have this fix, should help with these issues in Gradle.

@jaikiran
Copy link
Member

Now that I have seen/tried this fix against some real application, I'm going to mark this issue as fixed for (upcoming) 1.6 version of Quarkus.

@jaikiran jaikiran added this to the 1.6.0 - master milestone Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants