I am running gatling locally and for some reason, the simulation log is empty resulting in Exception Below:
Exception in thread "main" java.lang.UnsupportedOperationException: Files List(/Users/cluu/dev/execution-engine-qa/gatling/target/gatling/test-20221004190816728/simulation.log) don't contain any valid run record
There was no error when running the test. There are plenty of requests in my test
`---- Requests ------------------------------------------------------------------
Global (OK=23 KO=0 )
getToken (OK=1 KO=0 )
Post a model (OK=1 KO=0 )
Post prediction (OK=1 KO=0 )
Status_1_PENDING (OK=1 KO=0 )
Status_1_INPROGRESS (OK=19 KO=0 )`
This is the log before the error
Parsing log file(s)... 15:29:05.880 [INFO ] i.g.c.s.LogFileReader$ - Collected List(/Users/cluu/dev/execution-engine-qa/gatling/target/gatling/feepostpredictiondifferentmodel-20221004202840251/simulation.log) from feepostpredictiondifferentmodel-20221004202840251 15:29:05.896 [INFO ] i.g.c.s.LogFileReader - First pass 15:29:05.900 [INFO ] i.g.c.s.LogFileReader - First pass done: read 0 lines
It seems that I have to run the IDE as root in order to avoid the error. I’m using IntelliJ. This is the first time I encounter such issue. Do you have any idea why it is so?
It still doesn’t make sense that I can build as my user and cannot run the test. I assume that if I can create a build and the test results are recorded within the build structure, it should be fine right?
I’ll try to recreate to see if it will fix the issue.
target, and its subdirectories classes, resources, etc. may be writable to your “normal” user.
But not the subdirectory where gatling write/read the logs (ie: /Users/cluu/dev/execution-engine-qa/gatling/target/gatling)
Thanks for the clarification. I guess I should not have to do anything special in order to run the test. This is the first time I encounter such issue.
This is a Linux/MacOS user issue, not a Gatling one.
You’ve either run a chown or chmod that broke the existing permission or run Gatling under the root at some point, which created some directories and files your regular user can’t access.
I believe I have found the cause for the error. It seems that if I use loop in my test, in this case it’s asLongAs loop, the encounter the issue. If I remove the loop, the report gets generated normally.
With the additional information, would that help with identifying the cause of the issue? I makes no sense for the behavior to be related to permission if I a report can be generated without using loop.
Since this the only thread that I could find regarding this simulation.log issue, I will be posting my questions here. I have also searched through the GitHub issues but to avail.
My issue is that Gatling is inconsistent in writing to the simulation.log. By running the same test multiple times, Gatling would sometimes write to the simulation.log and sometimes doesn’t. Hence, I could not reproduce the bug consistently.
The test basically send GET requests to a SOAP API and that’s about it. Unfortunately, I could not provide the code since it is my company’s code. The logs are showing that the requests are successfully sent and response received but for most of the time, the simulation.log is empty.
May I know which part of the gatling code are used for recording response time and writing to the log file so that I could look more into it?
================================================================================
2023-07-13 11:25:45 10s elapsed
---- Requests ------------------------------------------------------------------
> Global (OK=2 KO=0 )
> getSession (OK=2 KO=0 )
-----fetchTest --------------------------------------------------------------
[##########################################################################]100%
waiting: 0 / active: 0 / done: 2
================================================================================
Simulation gatling.PerfSimulation completed in 10 secondsParsing log file(s)...
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.gatling.plugin.util.ForkMain.runMain(ForkMain.java:67)
at io.gatling.plugin.util.ForkMain.main(ForkMain.java:35)
Caused by: java.lang.UnsupportedOperationException: Files List(Path/to/target/gatling/perfsimulation-20230713152533410/simulation.log) don't contain any valid run record
at io.gatling.charts.stats.LogFileReader.$anonfun$firstPass$2(LogFileReader.scala:142)
at scala.Option.getOrElse(Option.scala:201)
at io.gatling.charts.stats.LogFileReader.firstPass(LogFileReader.scala:142)
at io.gatling.charts.stats.LogFileReader.$anonfun$read$1(LogFileReader.scala:58)
at io.gatling.charts.stats.LogFileReader.parseInputFiles(LogFileReader.scala:79)
at io.gatling.charts.stats.LogFileReader.read(LogFileReader.scala:58)
at io.gatling.app.RunResultProcessor.initLogFileData(RunResultProcessor.scala:50)
at io.gatling.app.RunResultProcessor.processRunResult(RunResultProcessor.scala:32)
at io.gatling.app.Gatling$.start(Gatling.scala:99)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:51)
at io.gatling.app.Gatling$.main(Gatling.scala:39)
at io.gatling.app.Gatling.main(Gatling.scala)
... 6 more
Correct me if I am wrong, but I believe 4.3.7 is the latest version for gatling-maven-plugin.
please check if you don’t have 100% build failures on your requests.
I have went through the log files and verified that there are no issues with the requests. I identified that this simulation.log issue only occur when making requests for this endpoint. It struck me as odd that every request and response are perfectly logged in a different log file but then nothing for simulation.log.
I think my issue lies at a missing dependency within my pom.xml file since I am using maven. For context, I am writing my testcases using Karate and performance testing with Karate-Gatling. I initially left out the dependency below in my pom.xml because it was not outlined in the framework’s setup process.
Once I included it, everything seems to be functional. I believe Karate-Gatling is possibly using an older version of gatling where such an issue still persist.
Ok, so your issue has absolutely nothing to do with genuine Gatling. Karate merely rides on our scheduler and reports but everything else is not Gatling components. In particular, performance is way lower.
For anything related to karate, please ask on StackOverflow not here.
But I would really recommend moving to genuine Gatling for load testing.