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

Image generation failed. Exit code: 1 on Microsoft Windows 10 Enterprise LTSC #25927

Closed
rprodan opened this issue Jun 2, 2022 · 5 comments
Closed
Labels
area/mandrel env/windows Impacts Windows machines kind/bug Something isn't working

Comments

@rprodan
Copy link

rprodan commented Jun 2, 2022

Describe the bug

I would like to build a native executable from Quarkus guide on Microsoft Windows 10 Enterprise LTSC 2019 10.0.17763 Build 17763 with mandrel-java17-22.1.0.0-Final.
All prerequisites are set up including initialized Microsoft Native Tools for Visual Studio.

However when I run the following command I get exception.

mvnw package -Dnative

Expected behavior

Successfully built native image from Quarkus guide.

Actual behavior

Running the following command in getting-started directory on local environment.

mvnw package -Dnative

I get the exception

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.9.2.Final:build (default) on project getting-started: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:400)
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:240)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [Help 1]

It is worth mentioning that another error appears before that

[ERROR] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Unable to get GraalVM version from the native-image binary.
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] C:\Program Files\Java\mandrel-java17-22.1.0.0-Final\bin\native-image.cmd -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -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=GB -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -J-Djava.awt.headless=true -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:+InlineBeforeAnalysis -H:-UseServiceLoaderFeature -H:+StackTrace getting-started-1.0.0-SNAPSHOT-runner -jar getting-started-1.0.0-SNAPSHOT-runner.jar
Error: Could not find or load main class Files\Java\mandrel-java17-22.1.0.0-Final\lib\svm\bin\\..\..\jvmci\graal.jar
Caused by: java.lang.ClassNotFoundException: Files\Java\mandrel-java17-22/1/0/0-Final\lib\svm\bin\\//\//\jvmci\graal/jar

How to Reproduce?

No response

Output of uname -a or ver

Microsoft Windows 10 Enterprise LTSC Version 10.0.17763 Build 17763

Output of java -version

openjdk 17.0.3 2022-04-19 OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7) OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.9.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: C:\Users\rprodan.m2\wrapper\dists\apache-maven-3.8.4-bin\52ccbt68d252mdldqsfsn03jlf\apache-maven-3.8.4 Java version: 17.0.3, vendor: Eclipse Adoptium, runtime: C:\Program Files\Java\mandrel-java17-22.1.0.0-Final Default locale: en_GB, platform encoding: Cp1250 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@rprodan rprodan added the kind/bug Something isn't working label Jun 2, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 2, 2022

/cc @Karm, @galderz, @zakkak

@quarkus-bot quarkus-bot bot added area/mandrel env/windows Impacts Windows machines labels Jun 2, 2022
@rprodan
Copy link
Author

rprodan commented Jun 3, 2022

Building native image with graalvm-ce-java17-22.1.0 works as expected.

@zakkak
Copy link
Contributor

zakkak commented Jun 3, 2022

Hi @rprodan it looks like the issue is caused by the "Program Files" directory (which includes a space). Can you please try moving mandrel under a different path that will not include spaces?

If that works, then you have a work around till we fix the issue, and we know what we need to fix :)
Thanks

@rprodan
Copy link
Author

rprodan commented Jun 7, 2022

@zakkak the issue was indeed with space character in my environment variable. Honestly speaking I haven't tought space characters are still troublesome nowadays. Non-ascii characters are different story though.

Thank you for your help.

@zakkak
Copy link
Contributor

zakkak commented Jun 7, 2022

Thanks for the confirmation @rprodan .

I am closing this as it's not a Quarkus issue.
Please follow graalvm/mandrel#386 if interested.

@zakkak zakkak closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mandrel env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants