You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Response Ops][Reporting] Classifying CSV timeouts with row count warnings as user error (#241349)
Resolves#232421
## Summary
Adds a mechanism for specifying user errors when generating a report and
classifying CSV reports that time out with a CSV row count warning as
user errors.
## To Verify
1. Modify the following to force a timeout with a row count warning:
```
--- a/src/platform/packages/private/kbn-generate-csv/src/generate_csv.ts
+++ b/src/platform/packages/private/kbn-generate-csv/src/generate_csv.ts
@@ -426,7 +426,8 @@ export class CsvGenerator {
// update iterator
currentRecord += table.rows.length;
- } while (totalRecords != null && currentRecord < totalRecords - 1);
+ } while (true);
+ // } while (totalRecords != null && currentRecord < totalRecords - 1);
// Add warnings to be logged
if (this.csvContainsFormulas && escapeFormulaValues) {
```
```
--- a/x-pack/platform/plugins/private/reporting/server/lib/tasks/run_report.ts
+++ b/x-pack/platform/plugins/private/reporting/server/lib/tasks/run_report.ts
@@ -406,7 +406,7 @@ export abstract class RunReportTask<TaskParams extends ReportTaskParamsType>
cancellationToken.cancel();
jobTimedOut = true;
resolve();
- }, this.queueTimeout);
+ }, 150 /* this.queueTimeout*/);
```
2. Start ES and Kibana. Install the sample data logs and then navigate
to Discover to export a CSV for the last 15 days.
3. In the logs, you should see the report end in a timeout
```
[2025-10-31T09:59:57.785-04:00][WARN ][plugins.reporting.csv-searchsource-export.execute-job:f34953e0-c127-4ac3-b3d4-5f917f2567ec] ES scroll returned fewer total hits than expected!
[2025-10-31T09:59:57.785-04:00][WARN ][plugins.reporting.csv-searchsource-export.execute-job:f34953e0-c127-4ac3-b3d4-5f917f2567ec] Search result total hits: 2952. Row count: 189
[2025-10-31T09:59:57.785-04:00][ERROR][plugins.reporting.runTask.f34953e0-c127-4ac3-b3d4-5f917f2567ec] Error: ReportingError(code: queue_timeout_error)
at operation (run_report.ts:594:25)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at retryOnError (retry_on_error.ts:32:20)
at Object.run (run_report.ts:559:13)
at TaskManagerRunner.run (task_runner.ts:419:22)
[2025-10-31T09:59:58.665-04:00][INFO ][plugins.reporting.runTask] Job f34953e0-c127-4ac3-b3d4-5f917f2567ec failed on its last attempt and will not be retried. Error: ReportingError(code: queue_timeout_error).
[2025-10-31T09:59:58.666-04:00][ERROR][plugins.taskManager] Task report:execute "edd4025a-daae-40c6-979e-52c3477651d4" failed: ReportingError(code: queue_timeout_error)
```
4. Navigate to
https://localhost:5601/api/task_manager/metrics?reset=false and see in
`task_run.value.by_type.report:execute` that the `user_errors` field is
incremented.
5. Undo the code changes and make sure normal report generation works as
expected.
---------
Co-authored-by: Elastic Machine <[email protected]>
0 commit comments