Jkube: Failure in Building Docker image for Wildfly application

Created on 27 Apr 2020  路  13Comments  路  Source: eclipse/jkube

I was trying to build a docker image of a wildfly application using k8s:build goal. But I'm facing this error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.560 s
[INFO] Finished at: 2020-04-27T21:03:19+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-2:build (default-cli) on project jkube-maven-sample-webapp-wildfly: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-2:build failed: Argument conflict: either shell or args should be specified and only in one form. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-2:build (default-cli) on project jkube-maven-sample-webapp-wildfly: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-2:build failed: Argument conflict: either shell or args should be specified and only in one form.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-2:build failed: Argument conflict: either shell or args should be specified and only in one form.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: Argument conflict: either shell or args should be specified and only in one form.
    at org.eclipse.jkube.kit.config.image.build.Arguments.validate (Arguments.java:108)
    at org.eclipse.jkube.kit.config.image.build.BuildConfiguration.initAndValidate (BuildConfiguration.java:241)
    at org.eclipse.jkube.kit.build.service.docker.ImageConfiguration.initAndValidate (ImageConfiguration.java:163)
    at org.eclipse.jkube.kit.build.service.docker.config.ConfigHelper.initAndValidate (ConfigHelper.java:128)
    at org.eclipse.jkube.maven.plugin.mojo.build.AbstractDockerMojo.initImageConfiguration (AbstractDockerMojo.java:877)
    at org.eclipse.jkube.maven.plugin.mojo.build.AbstractDockerMojo.execute (AbstractDockerMojo.java:470)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[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

How to Reproduce:

  1. Clone https://github.com/r0haaaan/jkube-wildfly-sample
  2. Run mvn k8s:build and you would get the same error

JKube version: 1.0.0-alpha-2

bug

All 13 comments

Why was this caused? Is it because of the change in the base image? (If so we must review other possibly affected generators)
If caused by change in model, must see if other (untested) images are affected too.

I face same issue on FMP 4.4.1

Ok, we can assume this was pre-existing bug then :relieved:

:flushed: that's more than 3 years ago, guess not many are using this generator...

Looking into https://github.com/fabric8io/fabric8-maven-plugin/issues/502 which was related to this issue. Maybe it was intentionally left blank

So then it's in fact probably related to the change in the base image.

We need to check any other image affected by this change (#158).

ah, no it's not related to change in the base image. I see this issue on all versions

For wildfly it uses jboss/wildfly:10.1.0.Final as base image. I didn't change it in #158 . As I said already, I see this issue in older versions of FMP too

I see the clue to the issue here:
IllegalArgumentException: Argument conflict: either shell or args should be specified and only in one form.
As the exception is thrown by our own image build config validator.

It would be good to at least check if the initial PR was already breaking (check out + check with https://github.com/fabric8io/fabric8-maven-plugin/commit/a783d114531ac5ffc479f9284cc64a1cd67357a8) or it actually worked (and why).

Yeah, I also think that maybe PR was already breaking. I will check this . For now, the container binds to the loopback address and no external requests ever get served.

Last working version for this was FMP 3.5.9. This started breaking since dmp upgrade to 0.26.1 in https://github.com/fabric8io/fabric8-maven-plugin/pull/1397

I think the quick win here is to set the getCommand for WildFlyAppSeverHandler to:
/opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0

Was this page helpful?
0 / 5 - 0 ratings