Fix JMeter HTML dashboard generation errors: Begin date cannot be after end date, non-empty output directory, corrupt JTL files, and missing column headers.
HTML Dashboard Generation Errors in JMeter
Section titled “HTML Dashboard Generation Errors in JMeter”Symptom
Section titled “Symptom”When attempting to generate an HTML report dashboard from a .jtl / .csv results file, the command fails in the terminal:
An error occurred: Cannot generate report: Error while processing samples:Consumer failed with message: Begin date cannot be after end dateOr when the target output folder already exists and contains files:
An error occurred: Cannot generate report:Error while processing samples: /reports is not empty, please choose an empty folderOr when the generated HTML dashboard shows empty charts and 0 total samples:
An error occurred: Cannot generate report:Results file is empty or missing required CSV headersQuick diagnosis (TL;DR)
Section titled “Quick diagnosis (TL;DR)”Folder is not empty: JMeter requires the destination directory (-o ./report_dir) to be completely empty or non-existent.Begin date cannot be after end date: Timestamps in the JTL file are corrupted, out of chronological order (e.g. from appending multiple runs without headers), or skewed across unsynced distributed worker system clocks.Missing CSV headers: The JTL was saved in XML format instead of CSV, orjmeter.save.saveservice.timestamp_formatwas misconfigured.
Common causes
Section titled “Common causes”| Error | Root Cause | Fix |
|---|---|---|
| Output directory not empty | Passing -o ./dashboard when ./dashboard already contains previous run files | Delete the folder before running: rm -rf ./dashboard |
Begin date cannot be after end date | JTL contains unsorted timestamps or multiple test runs appended | Sort JTL by timestamp or delete old JTL file before new run |
| Timezone / clock skew | Distributed worker nodes have drifting system clocks | Sync all worker clocks with NTP (chrony / systemd-timesyncd) |
| Empty charts / 0 samples | JTL was generated with XML format instead of CSV | Set jmeter.save.saveservice.output_format=csv |
| Missing columns error | Custom user.properties disabled mandatory dashboard columns | Restore default jmeter.save.saveservice.* properties |
Fix (ordered)
Section titled “Fix (ordered)”1. Ensure the Output Directory is Empty Before Generating
Section titled “1. Ensure the Output Directory is Empty Before Generating”JMeter will refuse to overwrite existing report folders to protect against accidental data loss. Always clean the directory prior to generation:
# Linux / macOSrm -rf ./html-report && jmeter -g results.jtl -o ./html-report
# Windows PowerShellRemove-Item -Recurse -Force ./html-report; jmeter -g results.jtl -o ./html-report2. Generate Dashboard Automatically in One CLI Command
Section titled “2. Generate Dashboard Automatically in One CLI Command”Instead of generating the dashboard in a separate second step, generate it natively at the end of the test execution:
# -n: CLI mode | -t: test plan | -l: results log | -e: generate report | -o: output directoryjmeter -n -t testplan.jmx -l results.jtl -e -o ./html-report -j jmeter.log3. Fix “Begin date cannot be after end date” (Sort JTL)
Section titled “3. Fix “Begin date cannot be after end date” (Sort JTL)”If multiple test runs were appended to the same JTL, or if distributed worker nodes flushed samples out of order:
# 1. Extract the header linehead -n 1 results.jtl > sorted.jtl
# 2. Sort remaining rows numerically by the first column (timestamp) and appendtail -n +2 results.jtl | sort -n -t ',' -k 1 >> sorted.jtl
# 3. Generate the report from the sorted filerm -rf ./html-reportjmeter -g sorted.jtl -o ./html-report4. Verify Required JTL Saveservice Properties
Section titled “4. Verify Required JTL Saveservice Properties”The HTML dashboard generator requires standard CSV formatting. Ensure these properties are set in bin/user.properties:
# Mandatory properties for HTML Dashboard generationjmeter.save.saveservice.output_format=csvjmeter.save.saveservice.timestamp_format=msjmeter.save.saveservice.bytes=truejmeter.save.saveservice.label=truejmeter.save.saveservice.latency=truejmeter.save.saveservice.response_code=truejmeter.save.saveservice.response_message=truejmeter.save.saveservice.successful=truejmeter.save.saveservice.thread_counts=truejmeter.save.saveservice.thread_name=truejmeter.save.saveservice.time=truejmeter.save.saveservice.connect_time=true5. Synchronize System Clocks (NTP) on Distributed Nodes
Section titled “5. Synchronize System Clocks (NTP) on Distributed Nodes”In distributed testing, if Worker A’s clock is 5 minutes ahead of Worker B, the merged JTL file will contain backwards timestamp jumps.
Ensure NTP is enabled across all machines:
# Check NTP synchronization status on Linuxtimedatectl statusRelated tools and topics
Section titled “Related tools and topics”| Resource | Use when |
|---|---|
| Dashboard Report user manual | Full guide to charts, APDEX, and dashboard metrics |
| CLI Command Builder | Generate clean CLI flags for report generation |
| Throughput stuck | Analyzing response time charts in the report |
| Distributed testing | Time synchronization across remote worker nodes |
Frequently asked questions
Section titled “Frequently asked questions”Can I generate an HTML report from an XML results file?
Section titled “Can I generate an HTML report from an XML results file?”No. The HTML dashboard generator only supports CSV format. You must configure jmeter.save.saveservice.output_format=csv before running the test.
Why is APDEX score showing 0 or bad ratings in my report?
Section titled “Why is APDEX score showing 0 or bad ratings in my report?”APDEX thresholds default to 500ms satisfied (T) and 1500ms tolerated (F). You can customize these thresholds in user.properties by setting jmeter.reportgenerator.apdex_satisfied_threshold=1000 and jmeter.reportgenerator.apdex_tolerated_threshold=3000.