apache/seatunnel · critical · InfluxdbConnectorException
CONNECT_FAILED
CONNECT_FAILED
Error message
connect influxdb failed, due to influxdb version info is unknown, the url is: {%s} What it means
InfluxDBSinkWriter.connect() creates a write client and pings the server. If influxdb.ping().isGood() returns false, the server is unreachable or did not answer the ping, so a CONNECT_FAILED InfluxdbConnectorException is thrown reporting the configured URL.
Source
Thrown at seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/sink/InfluxDBSinkWriter.java:157
batchList.clear();
}
private void checkFlushException() {
if (flushException != null) {
throw new InfluxdbConnectorException(
CommonErrorCodeDeprecated.FLUSH_DATA_FAILED,
"Writing records to InfluxDB failed.",
flushException);
}
}
public void connect() throws ConnectException {
if (influxdb == null) {
influxdb = InfluxDBClient.getWriteClient(sinkConfig);
String version = influxdb.version();
if (!influxdb.ping().isGood()) {
throw new InfluxdbConnectorException(
InfluxdbConnectorErrorCode.CONNECT_FAILED,
String.format(
"connect influxdb failed, due to influxdb version info is unknown, the url is: {%s}",
sinkConfig.getUrl()));
}
log.info("connect influxdb successful. sever version :{}.", version);
}
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Verify the URL in the InfluxDB sink config is reachable (curl the /ping endpoint).
- Confirm InfluxDB is running and the port is correct/exposed.
- Check network/firewall/DNS between SeaTunnel worker and InfluxDB.
- Ensure http vs https and authentication settings match the server version (1.x vs 2.x).
Example fix
// before url = "http://influxdb:9999" // after url = "http://influxdb:8086" // correct port for InfluxDB ping endpoint
Defensive patterns
Strategy: validation
Validate before calling
// before job run: health-check the endpoint
HttpResponse<String> resp = client.send(HttpRequest.newBuilder(URI.create(sinkUrl.replaceAll("/$","") + "/ping")).build(), HttpResponse.BodyHandlers.ofString());
if (resp.statusCode() >= 400) throw new IllegalStateException("InfluxDB not reachable at " + sinkUrl); Try / catch
try {
writer.connect();
} catch (InfluxdbConnectorException e) {
if (InfluxdbConnectorErrorCode.CONNECT_FAILED.equals(e.getErrorCode())) {
// alert / fail fast with URL context
}
throw e;
} Prevention
- Health-check the InfluxDB /ping endpoint before submitting the job.
- Pin and document the correct URL/port per environment.
- Verify connectivity from worker nodes, not just the client machine.
- Use DNS names stable across restarts.
When it happens
Trigger: Calling connect() during sink writer initialization when the InfluxDB host is down, the URL/port in sink config is wrong, credentials/network block access, or the server responds to version() but ping is not good.
Common situations: Typo in sink URL, InfluxDB not started or listening on another port, firewall/DNS issues in containerized deployments, wrong protocol (http vs https), or InfluxDB 1.x vs 2.x endpoint mismatch.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/81cb31bb9f873a35.
Report an issue: GitHub.