{"record":{"id":"96e00b5e117c6f16","repo":"apache/seatunnel","slug":"cannot-find-password-of-shard-shard-getnode","errorCode":null,"errorMessage":"Cannot find password of shard \" + shard.getNode().getAddress().getHostName()","messagePattern":"Cannot find password of shard \" \\+ shard\\.getNode\\(\\)\\.getAddress\\(\\)\\.getHostName\\(\\)","errorType":"exception","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ClickhouseFileSinkWriter.java","lineNumber":167,"sourceCode":"                        });\n        saveDataToFile(channel, element, shard);\n    }\n\n    private void nodePasswordCheck() {\n        if (!this.readerOption.isNodeFreePass()) {\n            shardRouter\n                    .getShards()\n                    .values()\n                    .forEach(\n                            shard -> {\n                                if (!this.readerOption\n                                                .getNodePassword()\n                                                .containsKey(\n                                                        shard.getNode().getAddress().getHostName())\n                                        && !this.readerOption\n                                                .getNodePassword()\n                                                .containsKey(shard.getNode().getHost())) {\n                                    throw new ClickhouseConnectorException(\n                                            ClickhouseConnectorErrorCode\n                                                    .PASSWORD_NOT_FOUND_IN_SHARD_NODE,\n                                            \"Cannot find password of shard \"\n                                                    + shard.getNode().getAddress().getHostName());\n                                }\n                            });\n        }\n    }\n\n    @Override\n    public Optional<CKFileCommitInfo> prepareCommit() throws IOException {\n        for (FileChannel channel : rowCache.values()) {\n            channel.close();\n        }\n        Map<Shard, List<String>> detachedFiles = new HashMap<>();\n        shardTempFile.forEach(\n                (shard, path) -> {\n                    List<String> clickhouseLocalFiles = null;","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ClickhouseFileSinkWriter.java#L149-L185","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the missing node's credentials to the node_pass/node_password config so the map is keyed by the same hostname ClickHouse reports","Ensure `node` and `node_pass` entries use identical host strings (hostname vs IP mismatch is the usual cause)","Alternatively set node_free_password = true if nodes genuinely have no password"],"exampleFix":"// before\nnode_pass = [{node = \"192.168.1.1\", password = \"pwd\"}]  // node list uses hostnames\n// after\nnode_pass = [{node = \"ck-node-1.example.com\", password = \"pwd\"}]  // match node hostnames exactly","handlingStrategy":"validation","validationCode":"Map<String,String> pw = readerOption.getNodePassword();\nfor (ClickhouseShard shard : shards) {\n    String host = shard.getNode().getAddress().getHostName();\n    if (!pw.containsKey(host) && !pw.containsKey(shard.getNode().getHost())) {\n        throw new IllegalStateException(\"Missing password for shard node: \" + host);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    writer = new ClickhouseFileSinkWriter(...);\n} catch (ClickhouseConnectorException e) {\n    // check PASSWORD_NOT_FOUND_IN_SHARD_NODE and fix node_pass config\n}","preventionTips":["Use identical host strings in `node` and `node_pass` configs","After scaling the ClickHouse cluster, update credential maps","Prefer node_free_password = true only when all nodes truly have no password"],"tags":["clickhouse","shard","credentials"],"backgroundTag":"missing-credentials","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}