{"record":{"id":"97f7bbe127a7fcd8","repo":"alibaba/DataX","slug":"eswriter-04","errorCode":"ESWriter-04","errorMessage":"status:[%d], error: %s, config not ignoreParseError so throw this error","messagePattern":"status:\\[(.+?)\\], error: (.+?), config not ignoreParseError so throw this error","errorType":"exception","errorClass":"NoReRunException","httpStatus":null,"severity":"error","filePath":"elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ElasticSearchWriter.java","lineNumber":1018,"sourceCode":"                        JestResult jestResult = esClient.bulkInsert(bulkaction);\n                        if (jestResult.isSucceeded()) {\n                            return null;\n                        }\n                        String msg = String.format(\"response code: [%d] error :[%s]\", jestResult.getResponseCode(),\n                                jestResult.getErrorMessage());\n                        LOGGER.warn(msg);\n                        if (esClient.isBulkResult(jestResult)) {\n                            BulkResult brst = (BulkResult) jestResult;\n                            List<BulkResult.BulkResultItem> failedItems = brst.getFailedItems();\n                            for (BulkResult.BulkResultItem item : failedItems) {\n                                if (item.status != 400) {\n                                    // 400 BAD_REQUEST 如果非数据异常,请求异常,则不允许忽略\n                                    throw DataXException.asDataXException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,\n                                            String.format(\"status:[%d], error: %s\", item.status, item.error));\n                                } else {\n                                    // 如果用户选择不忽略解析错误,则抛异常,默认为忽略\n                                    if (!Key.isIgnoreParseError(conf)) {\n                                        throw new NoReRunException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,\n                                                String.format(\n                                                        \"status:[%d], error: %s, config not ignoreParseError so throw this error\",\n                                                        item.status, item.error));\n                                    }\n                                }\n                            }\n                            return brst;\n                        } else {\n                            Integer status = esClient.getStatus(jestResult);\n                            switch (status) {\n                            case 429: // TOO_MANY_REQUESTS\n                                LOGGER.warn(\"server response too many requests, so auto reduce speed\");\n                                break;\n                            default:\n                                break;\n                            }\n                            throw DataXException.asDataXException(ElasticSearchWriterErrorCode.ES_INDEX_INSERT,\n                                    jestResult.getErrorMessage());","sourceCodeStart":1000,"sourceCodeEnd":1036,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ElasticSearchWriter.java#L1000-L1036","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n\"writer\": { \"name\": \"elasticsearchwriter\", \"ignoreParseError\": false }\n// after (accept row loss on parse errors)\n\"writer\": { \"name\": \"elasticsearchwriter\", \"ignoreParseError\": true }","handlingStrategy":"validation","validationCode":"// dry-run a small bulk first and inspect failed items\nif (failedItems.stream().anyMatch(i -> i.status == 400)) {\n    if (!Key.isIgnoreParseError(conf)) {\n        throw new IllegalStateException(\"Poison documents present and ignoreParseError=false; fix data or enable ignoreParseError\");\n    }\n}","typeGuard":null,"tryCatchPattern":"catch (NoReRunException e) {\n    // DataX marks the task dirty; re-running identical data will fail again\n    // either repair the documents (see item.error) or set ignoreParseError=true and re-run\n}","preventionTips":["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"],"tags":["elasticsearch","datax","bulk-insert","bad-request","config"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}