jmeter csv data set config issue: Could not read file header line for file

Viewed 3152

Im trying to extract data from a csv file to use in a POST request but i get the below error

java.lang.IllegalArgumentException: Could not read file header line for file v2summaryreport

the v2summaryreport is saved from another threads summary report and i want to use that csv for a new set of results that will be posted out.

csv config

error message

020-09-23 16:26:14,826 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2020-09-23 16:26:14,831 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 3-1
2020-09-23 16:26:14,832 INFO o.a.j.s.FileServer: Stored: v2summaryreport
2020-09-23 16:26:14,832 ERROR o.a.j.t.JMeterThread: Test failed!
java.lang.IllegalArgumentException: Could not read file header line for file v2summaryreport
    at org.apache.jmeter.services.FileServer.reserveFile(FileServer.java:283) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.config.CSVDataSet.iterationStart(CSVDataSet.java:183) ~[ApacheJMeter_components.jar:5.1.1 r1855137]
    at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:399) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:391) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.control.GenericController.next(GenericController.java:160) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.control.LoopController.next(LoopController.java:135) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:251) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
Caused by: java.lang.IllegalArgumentException: File v2summaryreport must exist and be readable
    at org.apache.jmeter.services.FileServer.createBufferedReader(FileServer.java:424) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.services.FileServer.readLine(FileServer.java:340) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.services.FileServer.readLine(FileServer.java:324) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.services.FileServer.reserveFile(FileServer.java:272) ~[ApacheJMeter_core.jar:5.1.1 r1855137]

Any help with this would be appreciated

2 Answers

File v2summaryreport must exist and be readable

It means that JMeter cannot find the CSV file under the given location

You need to supply either relative or full path the the file (in the majority of cases along with the extension) so I think it should be something like v2summaryreport.txt or v2summaryreport.jtl

Also pay attention to Execution Order of JMeter test elements as there might be a chance that being a Configuration Element CSV Data Set Config is executed before everything else so the file with the results isn't there yet.

Working with dynamic CSV files is not very supported use case, you might want to consider migrating to __CSVRead() function instead, see How to Pick Different CSV Files at JMeter Runtime article for example implementation.

It's happening because the location you provided is not correct to extract CSV file. And you have to make sure that data can be properly extracted from that CSV file before start running the script.

An example is attached here.

enter image description here

Related