alibaba/canal · error · ServerNotFoundException

no alive canal server for

Error message

no alive canal server for 

What it means

Error "no alive canal server for " thrown in alibaba/canal.

Source

Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java:73

        String runningPath = ZookeeperPathUtils.getDestinationServerRunning(destination);
        this.zkClient.subscribeDataChanges(runningPath, dataListener);
        initRunning(this.zkClient.readData(runningPath, true));
    }

    @Override
    public SocketAddress currentNode() {
        return nextNode();
    }

    @Override
    public SocketAddress nextNode() {
        if (runningAddress != null) {// 如果服务已经启动,直接选择当前正在工作的节点
            return runningAddress;
        } else if (!currentAddress.isEmpty()) { // 如果不存在已经启动的服务,可能服务是一种lazy启动,随机选择一台触发服务器进行启动
            return currentAddress.get(0);// 默认返回第一个节点,之前已经做过shuffle
        } else {
            throw new ServerNotFoundException("no alive canal server for " + destination);
        }
    }

    private void initClusters(List<String> currentChilds) {
        if (currentChilds == null || currentChilds.isEmpty()) {
            currentAddress = new ArrayList<>();
        } else {
            List<InetSocketAddress> addresses = new ArrayList<>();
            for (String address : currentChilds) {
                String[] strs = StringUtils.split(address, ":");
                if (strs != null && strs.length == 2) {
                    addresses.add(new InetSocketAddress(strs[0], Integer.parseInt(strs[1])));
                }
            }

            Collections.shuffle(addresses);
            currentAddress = addresses;// 直接切换引用
        }

View on GitHub (pinned to 87be50e876)

Solutions

  1. Verify at least one canal server in the cluster is running and reachable (check server logs and zk/registry node under /otter/canal/cluster).
  2. Check network connectivity and firewall between the client and the canal servers' admin/server ports.
  3. Confirm the destination is started on one of the cluster nodes and the client is using the same destination name.

When it happens

Trigger: Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java:73 when the library encounters an invalid state.

Common situations: No live canal server. Defensively re-resolve the node list from ZooKeeper before throwing, apply backoff between retries, and surface the last known nodes in the error to aid diagnosis.


AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14). Data as JSON: /api/errors/618a8db49ef5336e. Report an issue: GitHub.