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

dockerBuildNative fails due to native-image args parsing errors on windows #1098

Open
houcine7 opened this issue May 7, 2024 · 1 comment
Assignees
Labels
os: windows status: awaiting validation Waiting to be validated as a real issue type: bug Something isn't working

Comments

@houcine7
Copy link

houcine7 commented May 7, 2024

  • I'm using the version 4.5.2 and trying to build a docker native image with graalVM but I'm getting a parsing error in native-image arguments (because of spaces present in my home folder)

  • the .m2 location folder is at: C:\Users\Lahoucine EL ADDALI\.m2

  • The error output is the following:

[INFO] Args file written to: gcp\target\native-image-17170149290747285130.args
[INFO]
[INFO] --- mn:4.5.2:docker-native (default-docker-native) @ gcp ---
[WARNING] The parent POM of this project is not set to io.micronaut.platform:micronaut-parent
[INFO] Exposing port: 8080
[INFO] Using BASE_IMAGE: ghcr.io/graalvm/native-image-community:17-ol9
[INFO] GraalVM native image build args: [--no-fallback, -o, C:\\Users\\Public\\dev\\gcp-kubernetes-demo-java-maven\\users\\gcp\\target\\gcp, -H:ConfigurationFileDirectories=/home/app/graalvm-reachability-metadata//netty-codec-http2//4.1.80.Final,/home/app/graalvm-reachability-metadata//caffeine//3.1.2,/home/app/graalvm-reachability-metadata//netty-common//4.1.80.Final,/home/app/graalvm-reachability-metadata//netty-transport//4.1.80.Final,/home/app/graalvm-reachability-metadata//kotlin-stdlib//1.7.10,/home/app/graalvm-reachability-metadata//commons-compress//1.23.0,/home/app/graalvm-reachability-metadata//netty-buffer//4.1.80.Final,/home/app/graalvm-reachability-metadata//netty-handler//4.1.80.Final,/home/app/graalvm-reachability-metadata//netty-codec-http//4.1.80.Final,/home/app/graalvm-reachability-metadata//jackson-databind//2.15.2,/home/app/graalvm-reachability-metadata//logback-classic//1.4.9, --no-fallback, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-codec-http2\\4.1.108.Final\\netty-codec-http2-4.1.108.Final.jar\\E, ^/META-INF/native-image/, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-handler\\4.1.108.Final\\netty-handler-4.1.108.Final.jar\\E, ^/META-INF/native-image/, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-common\\4.1.108.Final\\netty-common-4.1.108.Final.jar\\E, ^/META-INF/native-image/, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-buffer\\4.1.108.Final\\netty-buffer-4.1.108.Final.jar\\E, ^/META-INF/native-image/, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-transport\\4.1.108.Final\\netty-transport-4.1.108.Final.jar\\E, ^/META-INF/native-image/, --exclude-config, \\QC:\\Users\\Lahoucine, EL, ADDALI\\.m2\\repository\\io\\netty\\netty-codec-http\\4.1.108.Final\\netty-codec-http-4.1.108.Final.jar\\E, ^/META-INF/native-image/, -H:ConfigurationFileDirectories=/home/app/generateResourceConfig,/home/app/generateTestResourceConfig]
[INFO] Using BASE_IMAGE_RUN: cgr.dev/chainguard/wolfi-base:latest
[INFO] Using CLASS_NAME: com.example.Application
[INFO] Step 1/16 : ARG BASE_IMAGE
[INFO]

[INFO] Step 2/16 : ARG BASE_IMAGE_RUN
[INFO]

[INFO] Step 3/16 : FROM ${BASE_IMAGE} AS builder
[INFO]

[INFO]  ---> d4837dfb86a3

[INFO] Step 4/16 : WORKDIR /home/app
[INFO]

[INFO]  ---> Using cache

[INFO]  ---> d33f168d2c67

[INFO] Step 5/16 : COPY classes /home/app/classes
[INFO]

[INFO]  ---> 212dc5617046

[INFO] Step 6/16 : COPY dependency/* /home/app/libs/
[INFO]

[INFO]  ---> 265fdf8da9f7

[INFO] Step 7/16 : COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
[INFO]

[INFO]  ---> 0c1dbe78ee4b

[INFO] Step 8/16 : COPY nativ[e]/generated /home/app/
[INFO]

[INFO]  ---> ff5314f4909c

[INFO] Step 9/16 : COPY *.args /home/app/graalvm-native-image.args
[INFO]

[INFO]  ---> 4d89308b2683

[INFO] Step 10/16 : ARG CLASS_NAME
[INFO]

[INFO]  ---> Running in e6ba9b89e1f9

[INFO] Removing intermediate container e6ba9b89e1f9

[INFO]  ---> 6ebc307fa459

[INFO] Step 11/16 : RUN native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"
[INFO]

[INFO]  ---> Running in 8bcc1b709805

[INFO] Error: Found unrecognized options while parsing argument file '/home/app/graalvm-native-image.args':
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-codec-http2\\\\4.1.108.Final\\\\netty-codec-http2-4.1.108.Final.jar\\\\E
^/META-INF/native-image/
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-handler\\\\4.1.108.Final\\\\netty-handler-4.1.108.Final.jar\\\\E
^/META-INF/native-image/
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-common\\\\4.1.108.Final\\\\netty-common-4.1.108.Final.jar\\\\E
^/META-INF/native-image/
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-buffer\\\\4.1.108.Final\\\\netty-buffer-4.1.108.Final.jar\\\\E
^/META-INF/native-image/
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-transport\\\\4.1.108.Final\\\\netty-transport-4.1.108.Final.jar\\\\E
^/META-INF/native-image/
ADDALI\\\\.m2\\\\repository\\\\io\\\\netty\\\\netty-codec-http\\\\4.1.108.Final\\\\netty-codec-http-4.1.108.Final.jar\\\\E
^/META-INF/native-image/

[ERROR] The command '/bin/sh -c native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"' returned a non-zero code: 20
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for users 1.0-SNAPSHOT:
[INFO]
[INFO] users .............................................. SUCCESS [  0.003 s]
[INFO] lib ................................................ SUCCESS [  1.282 s]
[INFO] users-gcp .......................................... FAILURE [ 18.466 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.710 s
[INFO] Finished at: 2024-05-07T13:43:52+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.micronaut.maven:micronaut-maven-plugin:4.5.2:docker-native (default-docker-native) on project gcp: Execution default-docker-native of goal io.micronaut.maven:micronaut-maven-plugin:4.5.2:docker-native failed: Could not build image: The command '/bin/sh -c native-image @/home/app/graalvm-native-image.args -H:Class=${CLASS_NAME} -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"' returned a non-zero code: 20 -> [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/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :gcp
@houcine7 houcine7 changed the title dockerBuildNative fails due to native-image args parsing on windows dockerBuildNative fails due to native-image args parsing errors on windows May 7, 2024
@houcine7
Copy link
Author

houcine7 commented May 7, 2024

Currently I'm working with this workaround by setting the maven local repository location to the public folder which doesn't contain any white space.

  • I'm achieving this by setting this env variable: set MAVEN_OPTS="-Dmaven.repo.local=C:\Users\Public\.m2\repository"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows status: awaiting validation Waiting to be validated as a real issue type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants