apache/seatunnel · critical · InfluxdbConnectorException
FLUSH_DATA_FAILED
FLUSH_DATA_FAILED
Error message
Writing records to InfluxDB failed.
What it means
InfluxDBSinkWriter.flush batches accumulated points and writes them via influxdb.write(batchPoints.build()). If the write throws and the retry loop has already exhausted sinkConfig.getMaxRetries(), it throws InfluxdbConnectorException with code FLUSH_DATA_FAILED and message 'Writing records to InfluxDB failed.' with the original exception as cause.
Source
Thrown at seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/sink/InfluxDBSinkWriter.java:118
if (sinkConfig.getBatchSize() > 0 && batchList.size() >= sinkConfig.getBatchSize()) {
flush();
}
}
public void flush() throws IOException {
checkFlushException();
if (batchList.isEmpty()) {
return;
}
BatchPoints.Builder batchPoints = BatchPoints.database(sinkConfig.getDatabase());
for (int i = 0; i <= sinkConfig.getMaxRetries(); i++) {
try {
batchPoints.points(batchList);
influxdb.write(batchPoints.build());
} catch (Exception e) {
log.error("Writing records to influxdb failed, retry times = {}", i, e);
if (i >= sinkConfig.getMaxRetries()) {
throw new InfluxdbConnectorException(
CommonErrorCodeDeprecated.FLUSH_DATA_FAILED,
"Writing records to InfluxDB failed.",
e);
}
try {
long backoff =
Math.min(
sinkConfig.getRetryBackoffMultiplierMs() * i,
sinkConfig.getMaxRetryBackoffMs());
Thread.sleep(backoff);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new InfluxdbConnectorException(
CommonErrorCodeDeprecated.FLUSH_DATA_FAILED,
"Unable to flush; interrupted while doing another attempt.",
e);
}View on GitHub (pinned to cf67b549a7)
Solutions
- Inspect the cause chain (the wrapped exception) for the real HTTP error and fix accordingly
- Increase maxRetries / retryBackoffMultiplierMs / maxRetryBackoffMs in the sink config for transient issues
- Resolve write conflicts: ensure consistent field types per measurement and series in the schema
- Check InfluxDB server health, retention policy existence, and user write permissions
- Reduce batch size if payloads are too large for the server
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight: server reachable and writable
if (!influxdb.ping().isGood()) throw new IllegalStateException("InfluxDB not reachable");
influxdb.version(); // triggers auth check; throws on 401 Try / catch
try {
sinkWriter.flush();
} catch (InfluxdbConnectorException e) {
if (String.valueOf(e.getCode()).contains("FLUSH_DATA_FAILED")) {
log.error("Flush failed after all retries; root cause: ", e.getCause());
// alert / restart writer
}
throw e;
} Prevention
- Always inspect getCause() — the message is generic but the cause holds the real HTTP error
- Tune maxRetries/retryBackoffMultiplierMs/maxRetryBackoffMs for transient outages
- Keep field types consistent per measurement to avoid InfluxDB write conflicts
- Monitor InfluxDB health and rate limits (429) during heavy write jobs
When it happens
Trigger: Any exception on influxdb.write() that persists across all configured retries: connection drops to the InfluxDB server, write endpoint errors (400 bad points, 429 rate limit, 500/503), auth failures, or points that violate field-type consistency for the measurement.
Common situations: InfluxDB restarted or under load mid-job; conflicting field types written to the same measurement (InfluxDB rejects type conflicts); batch too large for the server; network interruption; write privileges revoked (403).
Related errors
- FLUSH_DATA_FAILED
- WRITER_OPERATION_FAILED
- Failed to write %d items to table %s after %d retries
- WRITE_FAILED
- Failed to flush data in prepareCommit
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/c12ac4171093d28e.
Report an issue: GitHub.