apache/seatunnel · critical · InfluxdbConnectorException
CONNECT_FAILED
CONNECT_FAILED
Error message
Connect influxdb failed, the url is: {%s} What it means
InfluxDBClient.getInfluxDB builds an InfluxDB client and verifies connectivity by calling ping(); if ping() does not return isGood(), it throws InfluxdbConnectorException with code CONNECT_FAILED including the configured URL. The client object was created but the server did not respond with a healthy pong, so the source/sink cannot proceed.
Source
Thrown at seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/client/InfluxDBClient.java:77
.build();
Request build = request.newBuilder().url(httpUrl).build();
return chain.proceed(build);
}
});
InfluxDB influxdb =
new InfluxDBImpl(
config.getUrl(),
StringUtils.isEmpty(config.getUsername())
? StringUtils.EMPTY
: config.getUsername(),
StringUtils.isEmpty(config.getPassword())
? StringUtils.EMPTY
: config.getPassword(),
clientBuilder,
format);
String version = influxdb.version();
if (!influxdb.ping().isGood()) {
throw new InfluxdbConnectorException(
InfluxdbConnectorErrorCode.CONNECT_FAILED,
String.format("Connect influxdb failed, the url is: {%s}", config.getUrl()));
}
log.info("connect influxdb successful. sever version :{}.", version);
return influxdb;
}
public static void setWriteProperty(InfluxDB influxdb, SinkConfig sinkConfig) {
String rp = sinkConfig.getRp();
if (!StringUtils.isEmpty(rp)) {
influxdb.setRetentionPolicy(rp);
}
}
public static InfluxDB getWriteClient(SinkConfig sinkConfig) throws ConnectException {
InfluxDB influxdb = getInfluxDB(sinkConfig);
influxdb.setDatabase(sinkConfig.getDatabase());
setWriteProperty(getInfluxDB(sinkConfig), sinkConfig);View on GitHub (pinned to cf67b549a7)
Solutions
- Verify the URL is reachable: curl http://<host>:8086/ping should return HTTP 204
- Check username/password in the connector config against the InfluxDB instance (auth-enabled servers reject bad credentials even on ping)
- Confirm network reachability from the SeaTunnel worker (firewall, security groups, K8s NetworkPolicy)
- Ensure the protocol scheme matches (https if TLS is enabled) and InfluxDB is listening on the configured port
Example fix
// before url = "http://influx:8087" // after (correct port) url = "http://influx:8086"
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight check before job submission
HttpURLConnection c = (HttpURLConnection) new URL(url + "/ping").openConnection();
c.setRequestProperty("Authorization", "Token " + token);
if (c.getResponseCode() != 204) throw new IllegalStateException("InfluxDB ping failed: " + c.getResponseCode()); Try / catch
try {
InfluxDB db = InfluxDBClient.getInfluxDB(config);
} catch (InfluxdbConnectorException e) {
if (e.getCode() == InfluxdbConnectorErrorCode.CONNECT_FAILED) {
log.error("InfluxDB unreachable at {} — check host/port/auth", config.getUrl());
}
throw e;
} Prevention
- curl /ping from the SeaTunnel worker host before submitting jobs
- Verify scheme (http/https) and port (default 8086) in config
- Check credentials whenever InfluxDB auth is enabled
- Ensure firewall/NetworkPolicy allows worker-to-InfluxDB traffic
When it happens
Trigger: InfluxDB server unreachable at config.getUrl() (wrong host/port), server up but the /ping endpoint returning non-OK (e.g. auth enabled and credentials wrong), proxy/firewall dropping requests, or server overloaded returning 5xx on ping.
Common situations: Typos in the url config (http vs https, wrong port instead of 8086), InfluxDB container not started in dev environments, reverse TLS termination misconfigured, credentials rotated so the authenticated ping fails, Kubernetes NetworkPolicy blocking pod-to-pod traffic.
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/91c212010e039b0d.
Report an issue: GitHub.