alibaba/canal · error · CanalServerException
can't find destination:
Error message
can't find destination:
What it means
Thrown inside the instanceGenerator lambda when a destination name requested for startup is not present in the instanceConfigs map. instanceConfigs is populated from canal.destinations (or the destinations expression). When Canal tries to create an instance for a destination that was never declared, it throws CanalServerException. This fires at the moment a client subscribes to or Canal starts an unconfigured destination.
Source
Thrown at deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java:381
String managerAddress = getProperty(properties,
CanalConstants.getInstanceManagerAddressKey(CanalConstants.GLOBAL_NAME));
if (StringUtils.isNotEmpty(managerAddress)) {
if (StringUtils.equals(managerAddress, "${canal.admin.manager}")) {
managerAddress = adminManagerAddress;
}
globalConfig.setManagerAddress(managerAddress);
}
String springXml = getProperty(properties, CanalConstants.getInstancSpringXmlKey(CanalConstants.GLOBAL_NAME));
if (StringUtils.isNotEmpty(springXml)) {
globalConfig.setSpringXml(springXml);
}
instanceGenerator = destination -> {
InstanceConfig config = instanceConfigs.get(destination);
if (config == null) {
throw new CanalServerException("can't find destination:" + destination);
}
if (config.getMode().isManager()) {
PlainCanalInstanceGenerator instanceGenerator = new PlainCanalInstanceGenerator(properties);
instanceGenerator.setCanalConfigClient(managerClients.get(config.getManagerAddress()));
instanceGenerator.setSpringXml(config.getSpringXml());
return instanceGenerator.generate(destination);
} else if (config.getMode().isSpring()) {
SpringCanalInstanceGenerator instanceGenerator = new SpringCanalInstanceGenerator();
instanceGenerator.setSpringXml(config.getSpringXml());
return instanceGenerator.generate(destination);
} else {
throw new UnsupportedOperationException("unknown mode :" + config.getMode());
}
};
return globalConfig;View on GitHub (pinned to 87be50e876)
Solutions
- Add the destination to canal.destinations (comma-separated) or to the destinations expression.
- Create the instance config (conf/<destination>/instance.properties, or register it in canal-manager for MANAGER mode).
- Verify the client subscribes to the exact destination name (case-sensitive).
- If using auto-scan (spring mode), confirm the conf/<destination> directory exists and is readable.
Example fix
# before (canal.properties) canal.destinations = example # client subscribes to 'orders' # after canal.destinations = example,orders
Defensive patterns
Strategy: validation
Validate before calling
// Before subscribing, confirm the destination is configured
String destinations = CanalController.getDestinations(properties);
Set<String> configured = new HashSet<>(Arrays.asList(destinations.split(",")));
if (!configured.contains(destination)) {
throw new IllegalArgumentException("Destination '" + destination + "' is not in canal.destinations: " + destinations);
} Prevention
- Declare every destination in canal.destinations or via the destinations expression.
- For spring mode, create conf/<destination>/instance.properties.
- For manager mode, register the destination in canal-admin.
- Subscribe using the exact destination name (case-sensitive).
When it happens
Trigger: A client subscribes to destination 'X', but canal.destinations does not list 'X' and no spring/manager instance config exists for it; or an auto-scan picked up a directory but the destination name differs by case/whitespace.
Common situations: Destination name mismatch between client config and canal.destinations; a typo; missing instance properties file under conf/; when using manager mode, the destination not registered in canal-manager.
Related errors
- invalid destinations expr
- canal.user = , but canal.passwd is empty , pls check https:
- unknow mode : for monitor
- unknown mode :
- canal.admin.passwd is empty , pls check https://github.com/a
AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14).
Data as JSON: /api/errors/01205422a1894df4.
Report an issue: GitHub.