Getting Error Can't use the file Datawriter without setting the results directory

Gatling version: 3.11.5.2
Gatling flavour: Oracle Java JDK 21 (GraalVM 21.0.4+8.1)
Gradle Version: Gradle 8.8
Gatling Gradle plugin: “io.gatling.gradle” version “3.11.5.2”

Hello Team,

I’m getting below error during running my simulation script before updating,

Exception in thread "main" java.lang.IllegalArgumentException: Can't use the file DataWriter without setting the results directory
        at io.gatling.core.stats.DataWritersStatsEngine$.$anonfun$apply$2(DataWritersStatsEngine.scala:58)

In gatling.conf, I have

 data {
    writers = [console, file]               # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)

This was working in the previous gatling version (3.9.0). Any idea what I’m missing?

Thanks in advance.

Ashutosh

Of the importance of providing a reproducer as required when posting here.

I’ve just tried our official demo project: GitHub - gatling/gatling-gradle-plugin-demo-java
with Java 21 and gradle 8.8 and it just works.

Hello Stephane, I really appreciate for your quick response.

When I am running my service using below command, I am getting the datawriter error.

java $DEFAULT_JAVA_OPTS -jar service.jar -s <simulation type>

sleep ${SLEEP_TIME} # sleep for 5 mins to grab gatling reports from pod if desired

But when I am running the simulation with gatlingRun command its working fine. What could be the reason for this

./gradlew gatlingRun --simulation=simulation

Ahhh, so on contrary to what you state in your original message, you’re not running with our gradle plugin, but instead are trying to build a fatjar.

Sorry but we don’t support this usage (and have never supported it, there was never a trace of this in our documentation). Please stick to the official supported launched: the maven, gradle and sbt plugins, the standalone bundle and Gatling Enterprise.

For older version
Java SDK - 17
Gatling Gradle - 3.9.2
Gradle Version - 7.5.1

This same was working fine, but after updating to new version its showing this error.

Nothing we can do about it. As I wrote: please stick to the documented usage which is the only one supported. If you chose to go in uncharted lands, if it works, fine for you, but if it breaks, you’re on your own.

Thanks Stephane, I would like to express my gratitude for your prompt response and valuable insights. It is now clear to me that attempting to run Gatling simulations from a fatJar is not a supported practice, and I appreciate you highlighting this fact. I assure you that I will discontinue my efforts to use a fatJar for running Gatling simulations.

Moving forward, I am keen to explore alternative and officially supported methods, especially running Gatling within Docker containers.

Could you please provide me with any official documentation, guidelines, or best practices that the Gatling team has regarding the usage of Docker for executing Gatling simulations? Any recommended Docker images or specific configurations that are proven to work well with Gatling would be immensely helpful.

Thank you once again for your support. I look forward to your guidance and to properly utilizing Gatling in my performance testing workflow.