Build Failed in Jenkins

Hi,

When I am building Gatling in Jenkins, it is throwing below error – using Gatling Jenkins plugin as 1.1.1 and below in pom :

<gatling.version>2.1.6</gatling.version>
<gatling-maven-plugin.version>2.1.6</gatling-maven-plugin.version>
<scala-maven-plugin.version>3.2.0</scala-maven-plugin.version>
<scala.version>2.11.6</scala.version>

Failed to execute goal io.gatling:gatling-maven-plugin:2.1.6:execute (Test1) on project flightsearch-api: Gatling failed. Simulations compilation failed. Process exited with an error: 1

Guys,
Please help, any lead will be fine.

Well: Simulations compilation failed.

You’ve got a compilation error in your script, you need to fix it.

The script is passing and generating reports in my IDE when build with maven.

Below is the extended error:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.1.6:execute (Test1) on project flightsearch-api: Gatling failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
	at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
	at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:328)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Gatling failed.
	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:191)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 30 more
Caused by: io.gatling.mojo.CompilationException: Simulations compilation failed.
	at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:209)
	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:181)
	... 32 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:151)
	at io.gatling.mojo.Fork.run(Fork.java:81)
	at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:207)
	... 33 more

Hi,

Any help on this…?
I tried using the scala file of https://github.com/gatling/gatling-maven-plugin-demo/blob/master/src/test/scala/computerdatabase/BasicSimulation.scala
getting the same error.

Thanks,
Prakhar

Please suggest

Are you using a specific Maven profile to run your simulations on Jenkins ?

attached is the pom. I am not using any specific profiles but yes using build options as clean install in Jenkins.

pom.xml (11.8 KB)

Your pom as a parent pom and probably private dependencies.
As is, it’s impossible to reproduce your set up and issue.

Please try to trim down your project, remove dependencies, come up with a minimal maven project reproducer and publish it on Github or Bintray.
You might even find your issue by yourself in the process.

Hi ,

Am also getting same error as mentioned in this post while i try to execute the gatling demo project in jenkin . Have attached sample gatling demo project here.

Please help to resolve this issue.

Thanks,
Poorni

gatling-maven-plugin-demo-master.zip (579 KB)

Could you please provide the FULL Jenkins log? There’s a chance the cause is in the logs before the stacktrace.
Make also sure that you don’t run with an old JDK, as explained in the doc, Gatling requires JDK7u6+.

Am using JDK 1.8 . Please find the jenkin logs

gatling-maven-plugin 2.0.0

[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.0.0:execute (default-cli) on project gatling-maven-plugin-demo: Gatling failed. Process exited with an error: 1 (Exit value: 1) → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.0.0:execute (default-cli) on project gatling-maven-plugin-demo: Gatling failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Gatling failed.
at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:177)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
… 30 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:151)
at io.gatling.mojo.GatlingJavaMainCallerByFork.run(GatlingJavaMainCallerByFork.java:65)
at scala_maven_executions.JavaMainCallerSupport.run(JavaMainCallerSupport.java:110)
at io.gatling.mojo.GatlingMojo.executeGatling(GatlingMojo.java:193)
at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:174)
… 32 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

gatling-maven-plugin 2.1.6

[INFO] ------------------------------------------------------------------------
[INFO] Building gatling-maven-plugin-demo 2.1.6
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ gatling-maven-plugin-demo —
[INFO] Deleting /opt/app/jenkin/jenkins_home/.jenkins/workspace/maven_gatling/target
[INFO]
[INFO] — gatling-maven-plugin:2.1.6:execute (default-cli) @ gatling-maven-plugin-demo —
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.597 s
[INFO] Finished at: 2015-06-29T09:28:16+02:00
[INFO] Final Memory: 10M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.1.6:execute (default-cli) on project gatling-maven-plugin-demo: Gatling failed. Simulations compilation failed. Process exited with an error: 1 (Exit value: 1) → [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
[JENKINS] Archiving /opt/app/jenkin/jenkins_home/.jenkins/workspace/maven_gatling/pom.xml to io.gatling/gatling-maven-plugin-demo/2.1.6/gatling-maven-plugin-demo-2.1.6.pom
channel stopped
Finished: FAILURE

Please check.

Thanks,
Poornima

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Did you try running with -X as suggested in order to get debug logs with more information?

I have the same issue, but somewhat intermittent.

I have a script that I can run on windows machines just fine. If I run on my linux agent then 1 out of 10 times will pass just fine. The other 9 times I get this:

**12:11:44** [ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.1.7:execute (default) on project iceamate-gatling: Gatling failed. Simulations compilation failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
**12:11:44** org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.1.7:execute (default) on project iceamate-gatling: Gatling failed.
**12:11:44** 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
**12:11:44** 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
**12:11:44** 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
**12:11:44** 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
**12:11:44** 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
**12:11:44** 	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
**12:11:44** 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
**12:11:44** 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
**12:11:44** 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
**12:11:44** 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
**12:11:44** 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
**12:11:44** 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
**12:11:44** 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
**12:11:44** 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
**12:11:44** 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
**12:11:44** 	at java.lang.reflect.Method.invoke(Method.java:497)
**12:11:44** 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
**12:11:44** 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
**12:11:44** 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
**12:11:44** 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
**12:11:44** Caused by: org.apache.maven.plugin.MojoExecutionException: Gatling failed.
**12:11:44** 	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:191)
**12:11:44** 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
**12:11:44** 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
**12:11:44** 	... 19 more
**12:11:44** Caused by: io.gatling.mojo.CompilationException: Simulations compilation failed.
**12:11:44** 	at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:209)
**12:11:44** 	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:181)
**12:11:44** 	... 21 more
**12:11:44** Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
**12:11:44** 	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
**12:11:44** 	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
**12:11:44** 	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:151)
**12:11:44** 	at io.gatling.mojo.Fork.run(Fork.java:81)
**12:11:44** 	at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:207)
**12:11:44** 	... 22 more
**12:11:44** [ERROR] 
**12:11:44** [ERROR] 
**12:11:44** [ERROR] For more information about the errors and possible solutions, please read the following articles:
**12:11:44** [ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException)

I should also add that my script is simple script, about 30 post and gets. While it runs on windows every time and intermittently on linux, if I shrink that script down to like 15 posts and gets kind of thing then it starts to run on linux just fine every time. It seems like the script length is what causes it to give me this generic mojo error that just exits.

I fixed it in case anyone is still looking for fixes for this issue. Turns out that there are separate jvm args for the compiler from gatling. When I added the zincJvmArgs to the pom file then it started working every time on the linux machine. Here is my config block of the pom if it helps anyone.

src/test/resources src/test/resources/data target/gatling/results src/test/resources/request-bodies src/test/scala -Xmx4096m -Xmx2048m true true true true

Interesting. The default Zinc JVM args don’t specify Xmx, hence the compiler JVM uses the 256M default.
How much can you shrink? 2G looks super huge for compiling! Isn’t 512M enough?