{"record":{"id":"5c8bd57b0903eaef","repo":"apache/druid","slug":"emissions-of-events-not-successful-d-s-with-m","errorCode":null,"errorMessage":"Emissions of events not successful[%d: %s], with message[%s].","messagePattern":"Emissions of events not successful\\[(.+?): (.+?)\\], with message\\[(.+?)\\]\\.","errorType":"http","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java","lineNumber":809,"sourceCode":"              timeoutMillis\n          );\n        }\n        throw e;\n      }\n\n      if (response.getStatusCode() == 413) {\n        accountFailedSending(sendingStartMs);\n        throw new ISE(\n            \"Received HTTP status 413 from [%s]. Batch size of [%d] may be too large, \"\n            + \"try adjusting maxBatchSizeBatch property\",\n            config.getRecipientBaseUrl(),\n            config.getMaxBatchSize()\n        );\n      }\n\n      if (response.getStatusCode() / 100 != 2) {\n        accountFailedSending(sendingStartMs);\n        throw new ISE(\n            \"Emissions of events not successful[%d: %s], with message[%s].\",\n            response.getStatusCode(),\n            response.getStatusText(),\n            response.getResponseBody(StandardCharsets.UTF_8).trim()\n        );\n      }\n\n      accountSuccessfulSending(sendingStartMs);\n    }\n\n    /**\n     * This method computes the timeout for sending a batch of events over HTTP, based on how much time it took to\n     * populate that batch. The idea is that if it took X milliseconds to fill the batch, we couldn't wait for more than\n     * X * {@link HttpEmitterConfig#httpTimeoutAllowanceFactor} milliseconds to send that data, because at the same time\n     * the next batch is probably being filled with the same speed, so we have to keep up with the speed.\n     *\n     * Ideally it should use something like moving average instead of plain last batch fill time in order to accomodate\n     * for emitting bursts, but it might unnecessary because Druid application might not produce events in bursts.","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java#L791-L827","documentation":"After posting a batch, any non-2xx response (other than the specially handled 413) causes the EmittingThread to throw ISE('Emissions of events not successful[%d: %s], with message[%s].') including the status code, status text, and the response body. It means the remote endpoint refused the events — an application-level HTTP failure during metric delivery.","triggerScenarios":"Recipient returns 4xx/5xx: auth failures (401/403), target service down (503), wrong recipientBaseUrl path (404), server errors while ingesting events.","commonSituations":"Misconfigured recipientBaseUrl; remote Druid overlord or metrics service overloaded; authentication/authorization changes on the receiving endpoint; transient 5xx during deploys.","solutions":["Check response body in the exception for the server's error detail and fix the root cause (auth, path, capacity).","Verify recipientBaseUrl points at the correct, reachable events endpoint.","Enable basic authentication/bearer config if the endpoint requires it.","Add retry at the infrastructure level (or use retryingEmitter wrapper) for transient 5xx responses."],"exampleFix":"// before\nconfig: recipientBaseUrl = http://overlord:8090/druid/indexer/v1 (wrong path)\n// after\nconfig: recipientBaseUrl = http://overlord:8090/druid/indexer/v1/worker (correct endpoint)","handlingStrategy":"retry","validationCode":"// health-check the recipient before relying on it\nint status = new URL(config.getRecipientBaseUrl()).openConnection()\n    .getInputStream() != null ? 200 : 500; // plus auth/path checks","typeGuard":null,"tryCatchPattern":"try {\n  emitter.emit(event);\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Emissions of events not successful\")) {\n    // parse status code from message; retry transient 5xx via wrapper emitter\n  }\n}","preventionTips":["Verify recipientBaseUrl, auth, and endpoint health before production","Wrap with a retrying emitter for transient 5xx","Monitor emitter failure logs and response codes"],"tags":["http","remote-endpoint","metrics","emitter"],"backgroundTag":"http-error-response","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}