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 native-image TS Failures on Windows, Mandrel 20.2.0.0, [Graal CE to be confirmed/WIP] #13275

Closed
Karm opened this issue Nov 13, 2020 · 16 comments
Labels
area/grpc gRPC area/infinispan Infinispan area/kubernetes area/mandrel env/windows Impacts Windows machines kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@Karm
Copy link
Member

Karm commented Nov 13, 2020

Hello,
I executed the Quarkus 1.9.0.Final TS on Windows with Mandrel 20.2.0.0 Windows build. It all went very well except for a repeated issue that brought down a dozen of test cases. This is how the test was run:

@echo off
for /f "tokens=5" %%g in ('dir mandrel-*.zip ^| findstr /R mandrel-.*.zip') do set ZIP_NAME=%%g
powershell -c "Expand-Archive -Path %ZIP_NAME% -DestinationPath . -Force"
echo ZIP_NAME: %ZIP_NAME%

for /f "tokens=5" %%g in ('dir /AD mandrel-* ^| findstr /R mandrel-.*') do set GRAALVM_HOME=%cd%\%%g
echo GRAALVM_HOME: %GRAALVM_HOME%

set "JAVA_HOME=%GRAALVM_HOME%"
set "PATH=%JAVA_HOME%\bin;%PATH%"

if not exist "%GRAALVM_HOME%\bin\native-image.cmd" (
  echo "Cannot find native-image tool. Quitting..."
  exit 1
) else (
  echo "native-image.cmd is present, good."
  cmd /C native-image --version
)

set "MODULES=-pl !google-cloud-functions,!google-cloud-functions-http,!kubernetes/maven-invoker-way"

pushd quarkus

call vcvars64
IF NOT %ERRORLEVEL% == 0 ( exit 1 )

mvnw clean install -DskipTests & mvnw verify -f integration-tests/pom.xml --fail-at-end --batch-mode -DfailIfNoTests=false -Dnative %MODULES%

Expected behavior

TS passes with flying colours 😃

Actual behavior

This is the run summary on Jenkins. It boils down to these 2 recurring issues that make 11 tests fail.

Passing arguments

%1 is not a valid Win32 application

Executing [C:\workspace\workspace\mandrel-20.2----5e1abe3a\OS_AXIS\w2k19\quarkus\integration-tests\grpc-interceptors\target/quarkus-integration-test-grpc-interceptors-1.9.0.Final-runner, -Dquarkus.http.port=8081, -Dquarkus.http.ssl-port=8444, -Dtest.url=http://localhost:8081, -Dquarkus.log.file.path=target\target\quarkus.log]
Caused by: java.io.IOException: Cannot run program "C:\workspace\workspace\mandrel-20.2----5e1abe3a\OS_AXIS\w2k19\quarkus\integration-tests\grpc-interceptors\target/quarkus-integration-test-grpc-interceptors-1.9.0.Final-runner": CreateProcess error=193, %1 is not a valid Win32 application
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application

For these:

  • io.quarkus.grpc.example.interceptors.HelloWorldEndpointIT
  • io.quarkus.it.infinispan.client.InfinispanClientFunctionalityInGraalITCase
  • io.quarkus.it.kubernetes.client.ConfigMapPropertiesIT
  • io.quarkus.it.kubernetes.client.KubernetesClientTestIT
  • io.quarkus.it.kubernetes.client.SecretPropertiesIT
  • io.quarkus.it.spaces.NativeGreetingResourceIT

Baking resources / creating keystore?

Caused by: java.nio.file.NoSuchFileException: server-keystore.jks

Executing [C:\workspace\workspace\mandrel-20.2----5e1abe3a\OS_AXIS\w2k19\quarkus\integration-tests\vertx-http\target/quarkus-integration-test-vertx-http-1.9.0.Final-runner, -Dquarkus.http.port=8081, -Dquarkus.http.ssl-port=8444, -Dtest.url=http://localhost:8081, -Dquarkus.log.file.path=target\target\target\target\target\quarkus.log]
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-11-12 11:24:23,559 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:587)
	at io.quarkus.runtime.Application.start(Application.java:90)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:93)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:62)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:104)
	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
Caused by: java.nio.file.NoSuchFileException: server-keystore.jks
	at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
	at java.nio.file.Files.newByteChannel(Files.java:370)
	at java.nio.file.Files.newByteChannel(Files.java:421)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
	at java.nio.file.Files.newInputStream(Files.java:155)
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.getFileContent(VertxHttpRecorder.java:650)
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.createSslOptions(VertxHttpRecorder.java:579)
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.doServerStart(VertxHttpRecorder.java:435)
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServer(VertxHttpRecorder.java:224)
	at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket-2064782366.deploy_0(VertxHttpProcessor$openSocket-2064782366.zig:136)
	at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket-2064782366.deploy(VertxHttpProcessor$openSocket-2064782366.zig:40)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:532)
	... 6 more

For these:

  • io.quarkus.it.vertx.AccessLogTestCaseIT
  • io.quarkus.it.vertx.Http2TestCaseIT
  • io.quarkus.it.vertx.NettyMainEventLoopGroupResourceIT
  • io.quarkus.it.vertx.VertxProducerResourceIT

Environment (please complete the following information):

  • Output of uname -a or ver: Microsoft Windows [Version 10.0.17763.107] (Windows 2019 server)
  • Output of java -version: OpenJDK 11.0.9-11
  • GraalVM version (if different from Java): Mandrel 20.2.0.0 Windows build
  • Quarkus version or git rev: 1.9.0.Final

FYI: @zakkak

@Karm Karm added the kind/bug Something isn't working label Nov 13, 2020
@ghost
Copy link

ghost commented Nov 13, 2020

@Karm
Copy link
Member Author

Karm commented Nov 13, 2020

OMG, I am sorry the bot picked up

set "MODULES=-pl !google-cloud-functions,!google-cloud-functions-http,!kubernetes/maven-invoker-way"

and tagged so many people 😞

@sberyozkin
Copy link
Member

sberyozkin commented Nov 13, 2020

@zakkak
Copy link
Contributor

zakkak commented Nov 13, 2020

@Karm the key/trust store issue should be resolved with the last line
at https://github.com/quarkusio/quarkus/blob/master/integration-tests/vertx-http/src/main/resources/application.properties#L11

Which is part of Quarkus 1.10.0.CR1 in case you want to give it a go @Karm.
However the test should work with Quarkus 1.9.0.Final as well since it includes the same flags just in a different place https://github.com/quarkusio/quarkus/blob/1.9/integration-tests/vertx-http/pom.xml#L158-L159

@zakkak
Copy link
Contributor

zakkak commented Apr 2, 2021

@Karm do we have any updates on this?

@cescoffier
Copy link
Member

@zakkak @Karm Any news?
It refers to an old version of Quarkus, so, except it you're sure it's not fixed yet and need some work, I'd like to close it.

@zakkak
Copy link
Contributor

zakkak commented Jun 7, 2021

I don't see this appearing in any of our workflows.
@Karm are you OK with closing this?

@Karm
Copy link
Member Author

Karm commented Jun 14, 2021

@zakkak @cescoffier Hello, this is still an issue, although in another module, with the current Q main and Mandrel 21.1, plus a number of linker issues and other failures. Lemme sort it out and open new issues for those that are not reported already.

10:30:42 [INFO] Running io.quarkus.it.bouncycastle.BouncyCastleJsseITCase
10:30:49 Executing [C:\workspace\workspace\mandrel-windo---df5df7a9\00a3d571\quarkus\integration-tests\bouncycastle-jsse\target/quarkus-integration-test-bouncycastle-jsse-999-SNAPSHOT-runner, -Dquarkus.http.port=8081, -Dquarkus.http.ssl-port=8444, -Dtest.url=http://localhost:8081, -Dquarkus.log.file.path=C:\workspace\workspace\mandrel-windo---df5df7a9\00a3d571\quarkus\integration-tests\bouncycastle-jsse\target\quarkus.log, -Dquarkus.log.file.enable=true]
10:30:49 __  ____  __  _____   ___  __ ____  ______ 
10:30:49  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
10:30:49  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
10:30:49 --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
10:30:49 2021-06-14 01:30:48,754 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.nio.file.NoSuchFileException: server-keystore.jks
10:30:49 	at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
10:30:49 	at java.nio.file.Files.newByteChannel(Files.java:371)
10:30:49 	at java.nio.file.Files.newByteChannel(Files.java:422)
10:30:49 	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
10:30:49 	at java.nio.file.Files.newInputStream(Files.java:156)
10:30:49 	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.getFileContent(VertxHttpRecorder.java:686)
10:30:49 	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.createSslOptions(VertxHttpRecorder.java:627)
10:30:49 	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.doServerStart(VertxHttpRecorder.java:466)
10:30:49 	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServer(VertxHttpRecorder.java:248)
10:30:49 	at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket-2064782366.deploy_0(VertxHttpProcessor$openSocket-2064782366.zig:166)
10:30:49 	at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket-2064782366.deploy(VertxHttpProcessor$openSocket-2064782366.zig:40)
10:30:49 	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:623)
10:30:49 	at io.quarkus.runtime.Application.start(Application.java:101)
10:30:49 	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:101)
10:30:49 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
10:30:49 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
10:30:49 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
10:30:49 	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
10:30:49 
10:30:49 Application was not started: io.quarkus.runtime.ApplicationLifecycleManager - Failed to start application (with profile prod)
10:30:49 [WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 6.532 s - in io.quarkus.it.bouncycastle.BouncyCastleJsseITCase

This is not a Github Workflow env. It's a Windows 2019 Server baremetal machine that builds and tests Q from source, i.e. it is not built on Linux and copied over. Mandrel used in the run I am looking at: 21.1-SNAPSHOT 63c791b4d1 (Mandrel Distribution) (Java Version 11.0.11+9)

@cescoffier
Copy link
Member

@Karm any update on this one?

@cescoffier
Copy link
Member

Closing as it relates to an outdated Mandrel version. Please re-open if it still happens.

@cescoffier cescoffier added the triage/out-of-date This issue/PR is no longer valid or relevant label Jan 16, 2022
@melloware
Copy link
Contributor

melloware commented Feb 18, 2023

I still get this issue with Mandrel 22.3 JDK 17

java.lang.RuntimeException: java.io.IOException: 
Cannot run program "C:\dev\primefaces\quarkus-primefaces\quarkus-primefaces-extensions\integration-tests\target/quarkus-primefaces-extensions-integration-tests-0.0.1-SNAPSHOT-runner": 
CreateProcess error=193, %1 is not a valid Win32 application

@Karm
Copy link
Member Author

Karm commented Feb 20, 2023

@melloware That probably just means the path is wrong, i.e. parameter one, %1, which is "C:\dev\primefaces\quarkus-primefaces\quarkus-primefaces-extensions\integration-tests\target/quarkus-primefaces-extensions-integration-tests-0.0.1-SNAPSHOT-runner" is not runnable.

The likely explanation is that the path is invalid due to mixed slashes \target/. If the native build failed somehow, it could also mean the file is empty or doesn't exist.

I don't recall seeing anything like that in the contemporary TS. e.g. a reasonably recent run log for Windows Q Native TS.

When I need to make Windows slashes behave, I sometimes do this:

SET WORKSPACE_POSSIX=%WORKSPACE:\=/%

which replaces all \ with /. Both types of slashes are actually valid path separators on Windows, as long as they are not mixed or confused with flags or parameters e.g. C:\myprogram /parameter /parameter

@Karm
Copy link
Member Author

Karm commented Feb 20, 2023

I am willing to give it a shot to reproduce it if you hold my hand a bit and show me where to start with Windows and Q PrimeFaces. Perhaps a small self contained reproducer project?

I used Quarkus PrimeFaces over here in eclipse/microprofile-starter#469 :-)
...yet I was under the impression it was JVM mode only back in the day.

@melloware
Copy link
Contributor

@Karm I just worked on this PrimeFaces Quarkus extension which gets it working in GraalVM Native mode!

https://github.com/quarkiverse/quarkus-primefaces

However if I run mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip on my Windows machine I get this error but on the GitHub Actions Ubuntu instance the integration tests are running fine.

java.lang.RuntimeException: java.io.IOException: Cannot run program "C:\dev\primefaces\quarkus-primefaces\quarkus-primefaces\integration-tests\target/quarkus-primefaces-integration-tests-2.12.1-SNAPSHOT-runner": CreateProcess error=193, %1 is not a valid Win32 application
Caused by: java.io.IOException: Cannot run program "C:\dev\primefaces\quarkus-primefaces\quarkus-primefaces\integration-tests\target/quarkus-primefaces-integration-tests-2.12.1-SNAPSHOT-runner": CreateProcess error=193, %1 is not a valid Win32 application
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application

Maven and Windows Info

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\Tools\apache-maven-3.8.6
Java version: 17.0.5, vendor: Eclipse Adoptium, runtime: C:\Tools\jdk-17
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

@melloware
Copy link
Contributor

While we are at it @Karm I tried your WORKSPACE_POSIX trick but when I crack open my native build in quarkus-native-resources.txt I am still seeing mixed slashes..

META-INF/resources/ui\misc\defaultcommand\multiple.xhtml

And its not resolving my URL's properly in native mode. Surely I can't be the only one building on Windows right?

@melloware
Copy link
Contributor

Unless I am setting SET WORKSPACE_POSSIX=%WORKSPACE:\=/% wrong? I just ran that command in my command prompt before building the native image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC area/infinispan Infinispan area/kubernetes area/mandrel env/windows Impacts Windows machines kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

6 participants