Report generation failing

[Pipeline] unstash[Pipeline] sh*14:49:14* [Gatling] Running shell script

*14:49:14* + mv /data/jenkins/workspace/production/Gatling/results /data/jenkins/workspace/production/Gatling/results-1546334354269*14:49:14* + touch /data/jenkins/workspace/production/Gatling/results-1546334354269*14:49:14* + /home/qeuser/gatling/bin/gatling.sh --reports-only /data/jenkins/workspace/production/Gatling/results-1546334354269*14:49:14* GATLING_HOME is set to /home/qeuser/gatling

*14:49:17* Parsing log file(s)...*14:49:17* Exception in thread "main" java.lang.NumberFormatException: For input string: " "*14:49:17* at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)*14:49:17* at java.lang.Long.parseLong(Long.java:578)*14:49:17* at java.lang.Long.parseLong(Long.java:631)*14:49:17* at scala.collection.immutable.StringLike.toLong(StringLike.scala:306)*14:49:17* at scala.collection.immutable.StringLike.toLong$(StringLike.scala:306)*14:49:17* at scala.collection.immutable.StringOps.toLong(StringOps.scala:29)*14:49:17* at io.gatling.charts.stats.LogFileReader.$anonfun$firstPass$1(LogFileReader.scala:102)*14:49:17* at scala.collection.Iterator.foreach(Iterator.scala:929)*14:49:17* at scala.collection.Iterator.foreach$(Iterator.scala:929)*14:49:17* at scala.collection.Iterator$ConcatIterator.foreach(Iterator.scala:167)*14:49:17* at io.gatling.charts.stats.LogFileReader.firstPass(LogFileReader.scala:86)*14:49:17* at io.gatling.charts.stats.LogFileReader.$anonfun$x$4$1(LogFileReader.scala:125)*14:49:17* at io.gatling.charts.stats.LogFileReader.parseInputFiles(LogFileReader.scala:63)*14:49:17* at io.gatling.charts.stats.LogFileReader.<init>(LogFileReader.scala:125)*14:49:17* at io.gatling.app.RunResultProcessor.initLogFileReader(RunResultProcessor.scala:67)*14:49:17* at io.gatling.app.RunResultProcessor.processRunResult(RunResultProcessor.scala:49)*14:49:17* at io.gatling.app.Gatling$.start(Gatling.scala:64)*14:49:17* at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)*14:49:17* at io.gatling.app.Gatling$.main(Gatling.scala:35)*14:49:17* at io.gatling.app.Gatling.main(Gatling.scala)

  1. make sure you use the latest Gatling version (3.0.2 as of now)
  2. make sure you’re not mixing Gatling modules with different versions
  3. only then, if problem still exists, please provide your simulation.log

this is my build.gradle file, any version I need to change?

`

apply plugin: ‘scala’

apply plugin: ‘idea’

apply plugin: ‘eclipse’

repositories {

mavenCentral()

maven {

url ‘http://repository.excilys.com/content/groups/public

}

}

dependencies {

compile ‘org.scala-lang:scala-library:2.11.8’

compile ‘com.fasterxml.uuid:java-uuid-generator:3.1.4’

testCompile ‘io.gatling.highcharts:gatling-charts-highcharts:3.0.2’

compile group: ‘commons-collections’, name: ‘commons-collections’, version: ‘3.2’

compile ‘org.slf4j:slf4j-api:1.7.5’

compile group: ‘org.apache.httpcomponents’, name: ‘httpclient’, version: ‘4.5.6’

compile group: ‘com.google.code.gson’, name: ‘gson’, version: ‘2.8.5’

compile group: ‘au.com.bytecode’, name: ‘opencsv’, version: ‘2.4’

compile group: ‘net.liftweb’, name: ‘lift-json_2.12’, version: ‘3.3.0’

compile ‘org.json:json:20090211’

}

`

Your scala-library version is wrong and is incompatible with the other Scala libraries you’re using (Gatling, Lift). It should be 2.12.8.

`

stage(‘Generating Report’) {
timestamps {
step([$class: ‘WsCleanup’])
for (int i = 0; i < nodesCount; i++) {
unstash “log${i}”
}
env.ts = new Date().getTime()
sh “mv $workspace/results $workspace/results-${ts} ; touch $workspace/results-${ts} ; ~/gatling/bin/gatling.sh --reports-only $workspace/results-${ts}”
gatlingArchive()

`

Above one is my code, and it is giving the following error: (simluation log is attached)

**16:24:42** [Gatling] Running shell script

**16:24:43** + mv /data/jenkins/workspace/production/Gatling/results /data/jenkins/workspace/production/Gatling/results-1546340082705
**16:24:43** + touch /data/jenkins/workspace/production/Gatling/results-1546340082705
**16:24:43** + /home/qeuser/gatling/bin/gatling.sh --reports-only /data/jenkins/workspace/production/Gatling/results-1546340082705
**16:24:43** GATLING_HOME is set to /home/qeuser/gatling
**16:24:45** Parsing log file(s)...
**16:24:45** Exception in thread "main" java.lang.NumberFormatException: For input string: " "
**16:24:45** 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
**16:24:45** 	at java.lang.Long.parseLong(Long.java:578)
**16:24:45** 	at java.lang.Long.parseLong(Long.java:631)
**16:24:45** 	at scala.collection.immutable.StringLike.toLong(StringLike.scala:306)
**16:24:45** 	at scala.collection.immutable.StringLike.toLong$(StringLike.scala:306)
**16:24:45** 	at scala.collection.immutable.StringOps.toLong(StringOps.scala:29)
**16:24:45** 	at io.gatling.charts.stats.LogFileReader.$anonfun$firstPass$1(LogFileReader.scala:102)
**16:24:45** 	at scala.collection.Iterator.foreach(Iterator.scala:929)
**16:24:45** 	at scala.collection.Iterator.foreach$(Iterator.scala:929)
**16:24:45** 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
**16:24:45** 	at io.gatling.charts.stats.LogFileReader.firstPass(LogFileReader.scala:86)
**16:24:45** 	at io.gatling.charts.stats.LogFileReader.$anonfun$x$4$1(LogFileReader.scala:125)
**16:24:45** 	at io.gatling.charts.stats.LogFileReader.parseInputFiles(LogFileReader.scala:63)
**16:24:45** 	at io.gatling.charts.stats.LogFileReader.<init>(LogFileReader.scala:125)
**16:24:45** 	at io.gatling.app.RunResultProcessor.initLogFileReader(RunResultProcessor.scala:67)
**16:24:45** 	at io.gatling.app.RunResultProcessor.processRunResult(RunResultProcessor.scala:49)
**16:24:45** 	at io.gatling.app.Gatling$.start(Gatling.scala:64)
**16:24:45** 	at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)
**16:24:45** 	at io.gatling.app.Gatling$.main(Gatling.scala:35)
**16:24:45** 	at io.gatling.app.Gatling.main(Gatling.scala)

simulation0.log (104 KB)

In Addition to my previous reply, I saw some changes in the file, where I am getting the error,
Can you please check and try to run from your end?

2017 version (LogFileReader.scala)

`

line.split(LogFileDataWriter.Separator) match {

case RawRequestRecord(array) =>
updateRunLimits(array(5).toLong, array(6).toLong)

case RawUserRecord(array) =>
updateRunLimits(array(4).toLong, array(5).toLong)

case RawGroupRecord(array) =>
updateRunLimits(array(4).toLong, array(5).toLong)

case RawRunRecord(array) =>
runMessages += RunMessage(array(1), array(2).trimToOption, array(3), array(4).toLong, array(5).trim)

case RawAssertionRecord(array) =>
val assertion: Assertion = {
val base64String = array(1)
val bytes = Base64.decode(base64String)
Unpickle[Assertion].fromBytes(ByteBuffer.wrap(bytes))
}

`

2018 version (LogFileReader.scala)

`

records.foreach { line =>
count += 1
if (count % LogStep == 0) logger.info(s"First pass, read $count lines")

line.split(DataWriterMessageSerializer.Separator) match {

case RawRequestRecord(array) =>
updateRunLimits(array(4).toLong, array(5).toLong)

case RawUserRecord(array) =>
updateRunLimits(array(4).toLong, array(5).toLong)

case RawGroupRecord(array) =>
updateRunLimits(array(3).toLong, array(4).toLong)

case RawRunRecord(array) =>
runMessages += RunMessage(array(1), array(2), array(3).toLong, array(4).trim, array(5).trim)

case RawAssertionRecord(array) =>
val assertion: Assertion = {
val base64String = array(1)
val bytes = Base64.decode(base64String)
Unpickle[Assertion].fromBytes(ByteBuffer.wrap(bytes))
}

`

Please review this one…

This simulation.log file has been edited and is now completely broken.
Giving up.

It is working fine now,

Gatling version was 2.3.1 on my jenkins Master node, thats the reason log parsing was throwing error.
but now it works fine.

Thanks