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

Failure in Building Docker image for Wildfly application #167

Closed
rohanKanojia opened this issue Apr 27, 2020 · 13 comments · Fixed by #168
Closed

Failure in Building Docker image for Wildfly application #167

rohanKanojia opened this issue Apr 27, 2020 · 13 comments · Fixed by #168
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@rohanKanojia
Copy link
Member

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

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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.

@manusa manusa added the bug Something isn't working label Apr 28, 2020
@manusa manusa added this to the 1.0.0 milestone Apr 28, 2020
@manusa manusa added this to In Progress in Sprint #183 Apr 28, 2020
@rohanKanojia
Copy link
Member Author

I face same issue on FMP 4.4.1

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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

@manusa manusa moved this from In Progress to Review in Sprint #183 Apr 28, 2020
@manusa manusa moved this from Review to Done in Sprint #183 Apr 28, 2020
@rohanKanojia
Copy link
Member Author

I think this was introduced in fabric8io/fabric8-maven-plugin#615

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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

@rohanKanojia
Copy link
Member Author

Looking into fabric8io/fabric8-maven-plugin#502 which was related to this issue. Maybe it was intentionally left blank

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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).

@manusa manusa reopened this Apr 28, 2020
@manusa manusa moved this from Done to In Progress in Sprint #183 Apr 28, 2020
@rohanKanojia
Copy link
Member Author

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

@rohanKanojia
Copy link
Member Author

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

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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 fabric8io/fabric8-maven-plugin@a783d11) or it actually worked (and why).

@rohanKanojia
Copy link
Member Author

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.

@rohanKanojia
Copy link
Member Author

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

@manusa
Copy link
Member

manusa commented Apr 28, 2020

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

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 28, 2020
…uests

+ Change wildfly CMD command in WildflyAppServerHandler
+ Add Webapp Wildfly Sample
@rohanKanojia rohanKanojia moved this from In Progress to Done in Sprint #183 Apr 28, 2020
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
No open projects
Sprint #183
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants