{"record":{"id":"f7fd021f9c9d6ad9","repo":"projectdiscovery/nuclei","slug":"elasticsearch-responded-with-an-error-string","errorCode":null,"errorMessage":"\"elasticsearch responded with an error: \" + string(b)","messagePattern":"\"elasticsearch responded with an error: \" \\+ string\\(b\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/reporting/exporters/es/elasticsearch.go","lineNumber":150,"sourceCode":"\t\treturn err\n\t}\n\treq.Body = io.NopCloser(bytes.NewReader(b))\n\n\tres, err := exporter.elasticsearch.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\t_ = res.Body.Close()\n\t}()\n\n\tb, err = io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn errors.New(err.Error() + \"error thrown by elasticsearch \" + string(b))\n\t}\n\n\tif res.StatusCode >= 300 {\n\t\treturn errors.New(\"elasticsearch responded with an error: \" + string(b))\n\t}\n\treturn nil\n}\n\n// Close closes the exporter after operation\nfunc (exporter *Exporter) Close() error {\n\treturn nil\n}\n","sourceCodeStart":132,"sourceCodeEnd":159,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/reporting/exporters/es/elasticsearch.go#L132-L159","documentation":"Error \"\"elasticsearch responded with an error: \" + string(b)\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/reporting/exporters/es/elasticsearch.go:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}