Skip to content

More than one native executable file found #3578

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

Closed
luidoc opened this issue Dec 2, 2024 · 1 comment · Fixed by #3631
Closed

More than one native executable file found #3578

luidoc opened this issue Dec 2, 2024 · 1 comment · Fixed by #3631
Assignees
Labels
bug Something isn't working
Milestone

Comments

@luidoc
Copy link

luidoc commented Dec 2, 2024

Describe the bug

I have a project developed with spring boot 3.3.x and compiled natively using GraalVM CE 21.0.1+12.1.
When trying to build the container image using kubernetes-maven-plugin version 1.17.0, I get the error “More than one native executable file found in /path-to-my-project/target”.
We can see below the output:

mvn k8s:resource k8s:build -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] 1.0.0-SNAPSHOT													  [pom]
[INFO]  1.0.0-SNAPSHOT  gitsyn                    [pom]
[INFO] Módulo de entrega 1.0.0-SNAPSHOT  gitsyn                [pom]
[INFO] gitsyn-ms                                                          [jar]
[INFO]
[INFO] -------------------< com.tests.gitsyn:gitsyn >--------------------
[INFO] Building 1.0.0-SNAPSHOT [1/4]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ----------------< com.tests.gitsyn:gitsyn-config >----------------
[INFO] Building  1.0.0-SNAPSHOT  gitsyn 1.0.0-SNAPSHOT [2/4]
[INFO]   from gitsyn-config/pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-config ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn-config ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ---------------< com.tests.gitsyn:gitsyn-entrega >----------------
[INFO] Building Módulo de entrega 1.0.0-SNAPSHOT  gitsyn 1.0.0-SNAPSHOT [3/4]
[INFO]   from gitsyn-entrega/pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-entrega ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn-entrega ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ------------------< com.tests.gitsyn:gitsyn-ms >------------------
[INFO] Building gitsyn-ms 1.0.0-SNAPSHOT                                  [4/4]
[INFO]   from gitsyn-ms/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-ms ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for 1.0.0-SNAPSHOT  1.0.0-SNAPSHOT:
[INFO]
[INFO] 1.0.0-SNAPSHOT  {project.aritfactID} SUCCESS [  1.638 s]
[INFO] 1.0.0-SNAPSHOT  gitsyn .... SUCCESS [  0.047 s]
[INFO] 1.0.0-SNAPSHOT  gitsyn  SUCCESS [  0.043 s]
[INFO] gitsyn-ms .......................................... FAILURE [  1.643 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.923 s
[INFO] Finished at: 2024-12-02T18:12:02+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.17.0:resource (default-cli) on project gitsyn-ms: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.17.0:resource failed: Cannot load service org.eclipse.jkube.springboot.generator.SpringBootGenerator defined in jar:file:/root/.m2/org/eclipse/jkube/jkube-kit-spring-boot/1.17.0/jkube-kit-spring-boot-1.17.0.jar!/META-INF/jkube/generator-default : java.lang.reflect.InvocationTargetException. Aborting: More than one native executable file found in /root/dev/gitsyn/gitsyn-ms/target -> [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 :gitsyn-ms

If we have a look at the contents of the target directory, we can see that there is only one executable file, gitsyn-ms-1.0.0-SNAPSHOT:

drwxr-xr-x. 5 root root       137 dic  2 18:06 classes
drwxr-xr-x. 3 root root        25 dic  2 18:06 generated-sources
-rwxr-xr-x. 1 root root 176034504 dic  2 18:11 gitsyn-ms-1.0.0-SNAPSHOT
-rw-r--r--. 1 root root  57724840 dic  2 18:08 gitsyn-ms-1.0.0-SNAPSHOT.jar
-rw-r--r--. 1 root root    571205 dic  2 18:08 gitsyn-ms-1.0.0-SNAPSHOT.jar.original
drwxr-xr-x. 3 root root        54 dic  2 18:08 graalvm-reachability-metadata
-rw-r--r--. 1 root root     38488 dic  2 18:11 libawt_headless.so
-rw-r--r--. 1 root root    809536 dic  2 18:11 libawt.so
-rw-r--r--. 1 root root    575400 dic  2 18:11 libawt_xawt.so
-rw-r--r--. 1 root root    239976 dic  2 18:11 libjavajpeg.so
-rwxr-xr-x. 1 root root     15520 dic  2 18:11 libjava.so
-rwxr-xr-x. 1 root root     15520 dic  2 18:11 libjvm.so
-rw-r--r--. 1 root root    588888 dic  2 18:11 liblcms.so
drwxr-xr-x. 2 root root        28 dic  2 18:06 maven-archiver
drwxr-xr-x. 3 root root        35 dic  2 18:06 maven-status
drwxr-xr-x. 3 root root        18 dic  2 18:06 spring-aot

If we look at the target directory, we will see that there is an executable named gitsyn-ms-1.0.0-SNAPSHOT (-rwxr-xr-x), which is the correct one, but as the files libjava.so and libjvm.so are also created, which also have execution permissions (-rwxr-xr-xr-x), the error occurs.
If I change the permissions of libjava.so and libjvm.so to (-rw-r--r--r--.), the error disappears.

It should be possible to tell the plugin which is the name of the executable file and that it does not take into account the others that exist in the same folder.

Eclipse JKube version

1.17.0

Component

Kubernetes Maven Plugin

Apache Maven version

3.8.5

Gradle version

None

Steps to reproduce

mvn k8s:resource k8s:build -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] 1.0.0-SNAPSHOT													  [pom]
[INFO]  1.0.0-SNAPSHOT  gitsyn                    [pom]
[INFO] Módulo de entrega 1.0.0-SNAPSHOT  gitsyn                [pom]
[INFO] gitsyn-ms                                                          [jar]
[INFO]
[INFO] -------------------< com.tests.gitsyn:gitsyn >--------------------
[INFO] Building 1.0.0-SNAPSHOT [1/4]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ----------------< com.tests.gitsyn:gitsyn-config >----------------
[INFO] Building  1.0.0-SNAPSHOT  gitsyn 1.0.0-SNAPSHOT [2/4]
[INFO]   from gitsyn-config/pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-config ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn-config ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ---------------< com.tests.gitsyn:gitsyn-entrega >----------------
[INFO] Building Módulo de entrega 1.0.0-SNAPSHOT  gitsyn 1.0.0-SNAPSHOT [3/4]
[INFO]   from gitsyn-entrega/pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-entrega ---
[INFO] k8s: `k8s:resource` goal is skipped.
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn-entrega ---
[INFO] k8s: `k8s:build` goal is skipped.
[INFO]
[INFO] ------------------< com.tests.gitsyn:gitsyn-ms >------------------
[INFO] Building gitsyn-ms 1.0.0-SNAPSHOT                                  [4/4]
[INFO]   from gitsyn-ms/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-ms ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for 1.0.0-SNAPSHOT  1.0.0-SNAPSHOT:
[INFO]
[INFO] 1.0.0-SNAPSHOT  {project.aritfactID} SUCCESS [  1.638 s]
[INFO] 1.0.0-SNAPSHOT  gitsyn .... SUCCESS [  0.047 s]
[INFO] 1.0.0-SNAPSHOT  gitsyn  SUCCESS [  0.043 s]
[INFO] gitsyn-ms .......................................... FAILURE [  1.643 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.923 s
[INFO] Finished at: 2024-12-02T18:12:02+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.17.0:resource (default-cli) on project gitsyn-ms: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.17.0:resource failed: Cannot load service org.eclipse.jkube.springboot.generator.SpringBootGenerator defined in jar:file:/root/.m2/org/eclipse/jkube/jkube-kit-spring-boot/1.17.0/jkube-kit-spring-boot-1.17.0.jar!/META-INF/jkube/generator-default : java.lang.reflect.InvocationTargetException. Aborting: More than one native executable file found in /root/dev/gitsyn/gitsyn-ms/target -> [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 :gitsyn-ms

Expected behavior

[INFO] ------------------< com.tests.gitsyn:gitsyn-ms >------------------
[INFO] Building gitsyn-ms 1.0.0-SNAPSHOT                                  [4/4]
[INFO]   from gitsyn-ms/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- k8s:1.17.0:resource (default-cli) @ gitsyn-ms ---
[INFO] k8s: Generators:
[INFO] k8s:  - dockerfile-simple
[INFO] k8s:  - quarkus
[INFO] k8s:  - spring-boot
[INFO] k8s:  - thorntail-v2
[INFO] k8s:  - wildfly-jar
[INFO] k8s:  - openliberty
[INFO] k8s:  - karaf
[INFO] k8s:  - vertx
[INFO] k8s:  - micronaut
[INFO] k8s:  - helidon
[INFO] k8s:  - java-exec
[INFO] k8s:  - webapp
[INFO] k8s: Generating resources
[INFO] k8s: Enrichers:
[INFO] k8s: - jkube-metadata
[INFO] k8s: - jkube-controller
[INFO] k8s: - jkube-controller-from-configuration
[INFO] k8s: - jkube-service
[INFO] k8s: - jkube-namespace
[INFO] k8s: - jkube-image
[INFO] k8s: - jkube-portname
[INFO] k8s: - jkube-project-label
[INFO] k8s: - jkube-well-known-labels
[INFO] k8s: - jkube-dependency
[INFO] k8s: - jkube-pod-annotations
[INFO] k8s: - jkube-git
[INFO] k8s: - jkube-maven-scm
[INFO] k8s: - jkube-serviceaccount
[INFO] k8s: - jkube-maven-issue-mgmt
[INFO] k8s: - jkube-debug
[INFO] k8s: - jkube-persistentvolumeclaim-storageclass
[INFO] k8s: - jkube-configmap-file
[INFO] k8s: - jkube-secret-file
[INFO] k8s: - jkube-openshift-route
[INFO] k8s: - jkube-openshift-project
[INFO] k8s: - jkube-ingress
[INFO] k8s: - jkube-healthcheck-quarkus
[INFO] k8s: - jkube-healthcheck-spring-boot
[INFO] k8s: - jkube-healthcheck-thorntail-v2
[INFO] k8s: - jkube-healthcheck-wildfly-jar
[INFO] k8s: - jkube-healthcheck-karaf
[INFO] k8s: - jkube-healthcheck-vertx
[INFO] k8s: - jkube-healthcheck-docker
[INFO] k8s: - jkube-healthcheck-webapp
[INFO] k8s: - jkube-healthcheck-micronaut
[INFO] k8s: - jkube-healthcheck-openliberty
[INFO] k8s: - jkube-healthcheck-smallrye
[INFO] k8s: - jkube-healthcheck-helidon
[INFO] k8s: - jkube-prometheus
[INFO] k8s: - jkube-service-discovery
[INFO] k8s: - jkube-container-env-java-options
[INFO] k8s: - jkube-revision-history
[INFO] k8s: - jkube-docker-registry-secret
[INFO] k8s: - jkube-triggers-annotation
[INFO] k8s: - jkube-openshift-imageChangeTrigger
[INFO] k8s: - jkube-name
[INFO] k8s: - jkube-replicas
[INFO] k8s: - jkube-imagepullpolicy
[INFO] k8s: Using resource templates from /root/dev/gitsyn/gitsyn-ms/src/main/jkube
[INFO] k8s: jkube-service: Adding a default service 'gitsyn-ms-service-app' with ports [8080]
[INFO] k8s: jkube-portname: Adding default port name http for port 8080
[INFO] k8s: jkube-debug: Debugging not enabled. To enable try setting the jkube.debug.enabled maven or system property to 'true'
[INFO] k8s: jkube-healthcheck-spring-boot: Adding readiness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 10 seconds
[INFO] k8s: jkube-healthcheck-spring-boot: Adding liveness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 180 seconds
[INFO] k8s: jkube-service-discovery: Using first mentioned service port '8080'
[INFO] k8s: jkube-revision-history: Adding revision history limit to 2
[INFO] k8s: jkube-docker-registry-secret: Adding secrets resources from plugin configuration
[INFO] k8s: Validating resources
[INFO] k8s: validating /root/dev/gitsyn/gitsyn-despliegue/kubernetes/gitsyn-ms-service-app-service.yml resource
[WARNING] Unknown keyword serializer - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
[WARNING] Unknown keyword deserializer - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
[INFO] k8s: validating /root/dev/gitsyn/gitsyn-despliegue/kubernetes/gitsyn-ms-deployment.yml resource
[INFO] k8s: validating /root/dev/gitsyn/gitsyn-despliegue/kubernetes/gitsyn-route.yml resource
[INFO]
[INFO] --- k8s:1.17.0:build (default-cli) @ gitsyn-ms ---
[INFO] k8s: Generators:
[INFO] k8s:  - dockerfile-simple
[INFO] k8s:  - quarkus
[INFO] k8s:  - spring-boot
[INFO] k8s:  - thorntail-v2
[INFO] k8s:  - wildfly-jar
[INFO] k8s:  - openliberty
[INFO] k8s:  - karaf
[INFO] k8s:  - vertx
[INFO] k8s:  - micronaut
[INFO] k8s:  - helidon
[INFO] k8s:  - java-exec
[INFO] k8s:  - webapp
JIB> Base image 'harbor.test.local/library/ubi9' does not use a specific image digest - build may not be reproducible
JIB> Containerizing application with the following files:
JIB>    Aplicacion:
JIB>            /root/dev/gitsyn/gitsyn-config/main/resources/dev
JIB>            /root/dev/gitsyn/gitsyn-config/main/resources/dev/gitsyn.properties
JIB>            /root/dev/gitsyn/gitsyn-config/main/resources/dev/logback-spring.xml
JIB>            /root/dev/gitsyn/gitsyn-ms/target/gitsyn-ms-1.0.0-SNAPSHOT
JIB>    Jkube-generated-layer-final-artifact:
JIB>            /root/dev/gitsyn/gitsyn-ms/target/gitsyn-ms-1.0.0-SNAPSHOT.jar
JIB> Getting manifest for base image harbor.test.local/library/ubi9...
JIB> Building aplicacion layer...
JIB> Building jkube-generated-layer-final-artifact layer...
JIB> The base image requires auth. Trying again for harbor.test.local/library/ubi9...
JIB> WWW-Authenticate for harbor.test.local/library/ubi9: Bearer realm="https://harbor.test.local/service/token",service="harbor-registry",scope="repository:library/ubi9:pull"
JIB> bearer auth succeeded for harbor.test.local/library/ubi9
JIB> Using base image with digest: sha256:3942c7ee20130b2f8c1ca153d0c380af185e145229d5e3a8d6bd34d4cde9ab43
JIB> Building jkube-generated-layer-final-artifact layer built sha256:013347b9d49dfc3942cf44fc3f925969ed36ca98908333985c4308b2da23cce0
JIB> Building aplicacion layer built sha256:135871585d9dcfa16a27733f27f0dbb772b3f07167e6d24b82638bb710495fb1
JIB>
JIB> Container entrypoint set to [/opt/apps/gitsyn-ms-1.0.0-SNAPSHOT, -Dapps_config_path=/opt/apps/apps-config, -Dapps_temp_path=/opt/apps/apps-temp, -Dapps_env=dev]
JIB> Building image to tar file...
JIB> [========================      ] 80,0% complete > writing to tar file
JIB> [==============================] 100,0% complete
[INFO] k8s:  /root/dev/gitsyn/gitsyn-ms/target/docker/harbor.test.local/aac/gitsyn/1.0.0-SNAPSHOT/tmp/jib-image.linux-amd64.tar successfully built
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for 1.0.0-SNAPSHOT {project.aritfactID} 1.0.0-SNAPSHOT:
[INFO]
[INFO] 1.0.0-SNAPSHOT                                       SUCCESS [  1.357 s]
[INFO] 1.0.0-SNAPSHOT gitsyn ....                           SUCCESS [  0.048 s]
[INFO] 1.0.0-SNAPSHOT gitsyn                                SUCCESS [  0.043 s]
[INFO] gitsyn-ms .......................................... SUCCESS [ 19.890 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.884 s
[INFO] Finished at: 2024-12-02T18:38:19+01:00
[INFO] ------------------------------------------------------------------------

Runtime

OpenShift

Kubernetes API Server version

1.25.3

Environment

Linux

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@luidoc luidoc added the bug Something isn't working label Dec 2, 2024
@manusa
Copy link
Member

manusa commented Dec 2, 2024

For the generator we'll need to find a reliable way to isolate the resulting binary from the copied lib files.
Your suggestion to be able to provide the name of the binary is a good fallback solution.

@manusa manusa moved this to Planned in Eclipse JKube Dec 11, 2024
@manusa manusa self-assigned this Jan 14, 2025
@manusa manusa moved this from Planned to In Progress in Eclipse JKube Jan 14, 2025
@manusa manusa moved this from In Progress to Review in Eclipse JKube Jan 15, 2025
@manusa manusa added this to the 1.18.0 milestone Jan 15, 2025 — with automated-tasks
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants