alibaba/DataX · error · NoReRunException
ESWriter-04
ESWriter-04
Error message
status:[%d], error: %s, config not ignoreParseError so throw this error
What it means
ElasticSearchWriter code ESWriter-04: during a Jest bulk insert, some items came back with status 400 (BAD_REQUEST). For non-400 statuses it always throws ES_INDEX_INSERT; for 400 it assumes a data/parse-level error, and if the job config does not set ignoreParseError=true, it throws NoReRunException — marking the failure as not re-runnable because re-sending the same bad document cannot succeed.
Source
Thrown at elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ElasticSearchWriter.java:1018
JestResult jestResult = esClient.bulkInsert(bulkaction);
if (jestResult.isSucceeded()) {
return null;
}
String msg = String.format("response code: [%d] error :[%s]", jestResult.getResponseCode(),
jestResult.getErrorMessage());
LOGGER.warn(msg);
if (esClient.isBulkResult(jestResult)) {
BulkResult brst = (BulkResult) jestResult;
List<BulkResult.BulkResultItem> failedItems = brst.getFailedItems();
for (BulkResult.BulkResultItem item : failedItems) {
if (item.status != 400) {
// 400 BAD_REQUEST 如果非数据异常,请求异常,则不允许忽略
throw DataXException.asDataXException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,
String.format("status:[%d], error: %s", item.status, item.error));
} else {
// 如果用户选择不忽略解析错误,则抛异常,默认为忽略
if (!Key.isIgnoreParseError(conf)) {
throw new NoReRunException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,
String.format(
"status:[%d], error: %s, config not ignoreParseError so throw this error",
item.status, item.error));
}
}
}
return brst;
} else {
Integer status = esClient.getStatus(jestResult);
switch (status) {
case 429: // TOO_MANY_REQUESTS
LOGGER.warn("server response too many requests, so auto reduce speed");
break;
default:
break;
}
throw DataXException.asDataXException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,
jestResult.getErrorMessage());View on GitHub (pinned to 80ec23d5c5)
Solutions
- Set "ignoreParseError": true in the elasticsearchwriter config if dropping unparseable rows is acceptable
- Better: fix the data — align date formats with the index mapping or relax dynamic_mapping before re-running
- Find the offending document via item.error in the log (the formatted message includes status and ES error text)
- Since it is a NoReRunException, DataX marks the task dirty — clean/repair records first, then re-run the split manually
Example fix
// before
"writer": { "name": "elasticsearchwriter", "ignoreParseError": false }
// after (accept row loss on parse errors)
"writer": { "name": "elasticsearchwriter", "ignoreParseError": true } Defensive patterns
Strategy: validation
Validate before calling
// dry-run a small bulk first and inspect failed items
if (failedItems.stream().anyMatch(i -> i.status == 400)) {
if (!Key.isIgnoreParseError(conf)) {
throw new IllegalStateException("Poison documents present and ignoreParseError=false; fix data or enable ignoreParseError");
}
} Try / catch
catch (NoReRunException e) {
// DataX marks the task dirty; re-running identical data will fail again
// either repair the documents (see item.error) or set ignoreParseError=true and re-run
} Prevention
- Test-sync a small sample to a staging index to surface 400-causing documents before full loads
- Set explicit index mappings (dates, dynamic: false/strict by choice) rather than relying on dynamic mapping
- Decide ignoreParseError policy up front; document that true means silent row loss
When it happens
Trigger: bulkIndexEntries() gets a Jest BulkResult whose getFailedItems() contain items with item.status == 400 while Key.isIgnoreParseError(conf) is false. Typical 400 causes: malformed JSON document built from the record, mapper parse error (dynamic mapping strict, date parse), or an id/column value Elasticsearch rejects.
Common situations: Records with dates not matching the index's format; strict dynamic mapping ('strict' throws 400 on unknown fields); nulls in required id column producing invalid index requests; batch where one poison record fails the whole task because ignoreParseError defaults to ignore=false in this deployment.
Related errors
- CONFIG_ERROR
- 通道容量[%d]必须大于0.
- dx_digest paras length must be 3
- dx_digest paras index 1 must be md5 or sha1
- dx_digest paras index 2 must be toUpperCase or toLowerCase
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/97f7bbe127a7fcd8.
Report an issue: GitHub.