Skip to content

JMeter CSV Data Set Config: File not found & Sharing Mode

Fix JMeter CSV Data Set Config File not found errors and data sharing issues. Master relative file paths, EOF settings, and multi-thread data distribution.

Difficulty
beginner
Guide type
troubleshooting
Estimated read time
6 min read
Last verified version
Verified JMeter 5.6

CSV Data Set Config: File not found & Sharing Issues

Section titled “CSV Data Set Config: File not found & Sharing Issues”

When executing a test in CLI mode, CI/CD pipelines, or distributed testing, one of the following errors occurs in jmeter.log:

2026-08-18 14:02:11,551 ERROR o.a.j.c.CSVDataSet: java.io.FileNotFoundException: users.csv (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)

Or a test data logic error occurs:

  • All concurrent virtual user threads read the exact same row of data simultaneously.
  • The test terminates unexpectedly early because of an unexpected End of File (EOF).
  • Dynamic CSV variables appear literally as \${username} in HTTP requests.
  • FileNotFoundException in CLI/CI: JMeter resolves relative CSV paths relative to the current working directory from which the jmeter command was executed, not necessarily the directory containing the .jmx file.
  • Duplicate Data Read: The CSV Data Set Config is placed inside a loop or child controller, resetting file pointers on each iteration, or Sharing Mode is misconfigured.
IssueCauseFix
CLI FileNotFoundExceptionInvoked jmeter from a folder other than the test plan folderUse \${__P(testdata.path)} or FileServer basedir
Distributed testing FileNotFoundExceptionCSV file exists on controller machine but was not copied to remote worker nodesCopy the CSV file to the exact same file path on all remote worker machines
All threads reading same lineCSV Data Set Config placed as child of a Loop ControllerMove CSV Data Set Config to the root of the Thread Group
Test stops prematurely”Stop thread on EOF” set to true on a small CSV fileSet “Recycle on EOF” to true and “Stop thread on EOF” to false
Variables not assigned”Variable Names” blank and CSV has no header rowProvide comma-separated variable names in configuration

To make .jmx test plans fully portable across local GUI, CLI, and CI/CD runners regardless of current working directory:

In CSV Data Set Config -> Filename, use the FileServer basedir function:

${__groovy(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())}/users.csv

Or configure a dynamic property with a default fallback:

${__P(data.dir,${__groovy(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())})}/users.csv

Now you can override data paths dynamically in CI/CD:

Terminal window
jmeter -n -t /plans/checkout.jmx -Jdata.dir=/ci-data/ -l results.jtl

2. Configure Sharing Mode for Concurrent Threads

Section titled “2. Configure Sharing Mode for Concurrent Threads”

The Sharing Mode setting controls how file pointers advance across virtual users:

Sharing ModeBehaviorBest for
All threads (Default)Single global file pointer shared across all thread groups. Each thread reads the next unique lineUnique user logins, single-use promo codes
Current thread groupEach Thread Group maintains its own independent file pointerSeparate scenarios that need the same test data set
Current threadEach individual virtual user reads the entire CSV file from line 1 independentlyIterating through a fixed list of product IDs per user

In CSV Data Set Config:

  • Recycle on EOF?: Set to True if you want threads to loop back to line 1 when the file ends.
  • Stop thread on EOF?: Set to False to allow tests to run for their scheduled duration. Set to True only if the test must stop immediately after exhausting the data file.

4. Fix CSV Distribution in Distributed / Remote Testing

Section titled “4. Fix CSV Distribution in Distributed / Remote Testing”

In distributed mode (jmeter -r):

  1. JMeter does NOT send CSV files over RMI to worker nodes.
  2. You must place the CSV file on every remote worker machine at the exact same path.
  3. If using shared network storage (NFS/EFS), ensure all worker pods mount the share at the identical mount path.
ResourceUse when
GUI works, CLI failsFile path and working directory differences
Functions and variablesBuilt-in functions like __CSVRead
Distributed testingManaging test data across remote workers
CLI Command BuilderGenerate CLI commands with dynamic data properties

Should I use CSV Data Set Config or __CSVRead() function?

Section titled “Should I use CSV Data Set Config or __CSVRead() function?”

Always prefer CSV Data Set Config. It is significantly faster, thread-safe, supports multi-threaded sharing modes, and handles quotes and delimiter parsing properly.

How do I split one CSV file across multiple worker nodes?

Section titled “How do I split one CSV file across multiple worker nodes?”

Split the CSV file into chunks before the test run (e.g. split -l 1000 users.csv worker_) and copy chunk 1 to Worker 1, chunk 2 to Worker 2.

On this page