apache/seatunnel · error · ClickhouseConnectorException

Cannot find password of shard " +…

Error message

Cannot find password of shard " + shard.getNode().getAddress().getHostName()

What it means

The ClickHouse file sink needs the SSH/ClickHouse password for each shard node to copy local files to the server. nodePasswordCheck verifies that readerOption.nodePassword contains an entry keyed by the shard node's hostname (or host); if neither key exists it throws PASSWORD_NOT_FOUND_IN_SHARD_NODE.

Solutions

  1. Add the missing node's credentials to the node_pass/node_password config so the map is keyed by the same hostname ClickHouse reports
  2. Ensure `node` and `node_pass` entries use identical host strings (hostname vs IP mismatch is the usual cause)
  3. Alternatively set node_free_password = true if nodes genuinely have no password

Example fix

// before
node_pass = [{node = "192.168.1.1", password = "pwd"}]  // node list uses hostnames
// after
node_pass = [{node = "ck-node-1.example.com", password = "pwd"}]  // match node hostnames exactly
Defensive patterns

Strategy: validation

Validate before calling

Map<String,String> pw = readerOption.getNodePassword();
for (ClickhouseShard shard : shards) {
    String host = shard.getNode().getAddress().getHostName();
    if (!pw.containsKey(host) && !pw.containsKey(shard.getNode().getHost())) {
        throw new IllegalStateException("Missing password for shard node: " + host);
    }
}

Try / catch

try {
    writer = new ClickhouseFileSinkWriter(...);
} catch (ClickhouseConnectorException e) {
    // check PASSWORD_NOT_FOUND_IN_SHARD_NODE and fix node_pass config
}

Prevention

When it happens

Trigger: ClickhouseFileSinkWriter construction when shardPasswordMap passed to FileReaderOption lacks an entry for a shard node's hostname; typically when the nodes listed in `node` config don't match the hosts in `node_pass`/password configuration.

Common situations: Config uses IP addresses in `node_pass` but `node_free_password` false with `node` listing hostnames (or vice versa); a shard node was added to the cluster but credentials weren't updated; typo in hostname in password map.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/96e00b5e117c6f16. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ClickhouseFileSinkWriter.java:167

                        });
        saveDataToFile(channel, element, shard);
    }

    private void nodePasswordCheck() {
        if (!this.readerOption.isNodeFreePass()) {
            shardRouter
                    .getShards()
                    .values()
                    .forEach(
                            shard -> {
                                if (!this.readerOption
                                                .getNodePassword()
                                                .containsKey(
                                                        shard.getNode().getAddress().getHostName())
                                        && !this.readerOption
                                                .getNodePassword()
                                                .containsKey(shard.getNode().getHost())) {
                                    throw new ClickhouseConnectorException(
                                            ClickhouseConnectorErrorCode
                                                    .PASSWORD_NOT_FOUND_IN_SHARD_NODE,
                                            "Cannot find password of shard "
                                                    + shard.getNode().getAddress().getHostName());
                                }
                            });
        }
    }

    @Override
    public Optional<CKFileCommitInfo> prepareCommit() throws IOException {
        for (FileChannel channel : rowCache.values()) {
            channel.close();
        }
        Map<Shard, List<String>> detachedFiles = new HashMap<>();
        shardTempFile.forEach(
                (shard, path) -> {
                    List<String> clickhouseLocalFiles = null;

View on GitHub (pinned to cf67b549a7)