I am trying to use Github self hosted runners to build the native image for my quarkus applications.
This is working great for me on the Github hosted runners, but I want to do this on self hosted runners so we don't blow our github actions minutes budget.
When I updated my workflow to use the self hosted runners I started getting this strange exception.
runners@ip-10-0-2-105:/opt/actions-runner/_work/prime-platform/prime-platform$ mvn clean package -DskipTests -Pnative
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.pubfactory.prime:prime-platform >-----------------
[INFO] Building Prime Platform dev-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ prime-platform ---
[INFO] Deleting /opt/actions-runner/_work/prime-platform/prime-platform/target
[INFO]
[INFO] --- git-commit-id-maven-plugin:5.0.0:revision (get-the-git-infos) @ prime-platform ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ prime-platform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:generate-code (default) @ prime-platform ---
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ prime-platform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 46 source files to /opt/actions-runner/_work/prime-platform/prime-platform/target/classes
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:generate-code-tests (default) @ prime-platform ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ prime-platform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ prime-platform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /opt/actions-runner/_work/prime-platform/prime-platform/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ prime-platform ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ prime-platform ---
[INFO] Building jar: /opt/actions-runner/_work/prime-platform/prime-platform/target/prime-platform-dev-SNAPSHOT-69f1447.jar
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:build (default) @ prime-platform ---
[INFO] [org.hibernate.Version] HHH000412: Hibernate ORM core version 5.6.5.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.472 s
[INFO] Finished at: 2022-03-24T20:21:26Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.7.5.Final:build (default) on project prime-platform: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor#build threw an exception: java.lang.IllegalStateException: java.nio.file.AccessDeniedException: /./target
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:891)
[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:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.nio.file.AccessDeniedException: /./target
[ERROR] at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
[ERROR] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[ERROR] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
[ERROR] at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
[ERROR] at java.base/java.nio.file.Files.createDirectory(Files.java:690)
[ERROR] at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:797)
[ERROR] at java.base/java.nio.file.Files.createDirectories(Files.java:783)
[ERROR] at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeGeneratedSchema(SmallRyeOpenApiProcessor.java:694)
[ERROR] at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeDocument(SmallRyeOpenApiProcessor.java:945)
[ERROR] at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.build(SmallRyeOpenApiProcessor.java:653)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
[ERROR] ... 6 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
runners@ip-10-0-2-105:/opt/actions-runner/_work/prime-platform/prime-platform$
I am using GraalVM 22.0.0.2, Java 11.0.14, Maven 3.8.4 and Quarkus 2.7.5
I tried rolling back to Quarkus 2.7.4 and this issue went away
It appears this is a bug in Quarkus 2.7.5.Final only. The fix was to downgrade to 2.7.4 and open https://github.com/quarkusio/quarkus/issues/24547