alibaba/canal · error · CanalClientException
failed to rollback after
Error message
failed to rollback after
What it means
Error "failed to rollback after " thrown in alibaba/canal.
Source
Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java:237
throw new CanalClientException("failed to fetch the data after " + times + " times retry");
}
@Override
public void rollback(long batchId) throws CanalClientException {
int times = 0;
while (times < retryTimes) {
try {
currentConnector.rollback(batchId);
return;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when rollbacking data from server:%s",
currentConnector != null ? currentConnector.getAddress() : "null"), t);
times++;
restart();
logger.info("restart the connector for next round retry.");
}
}
throw new CanalClientException("failed to rollback after " + times + " times retry");
}
@Override
public void rollback() throws CanalClientException {
int times = 0;
while (times < retryTimes) {
try {
currentConnector.rollback();
return;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when rollbacking data from server:%s",
currentConnector != null ? currentConnector.getAddress() : "null"), t);
times++;
restart();
logger.info("restart the connector for next round retry.");
}
}
View on GitHub (pinned to 87be50e876)
Solutions
- Check that the batchId being rolled back was previously returned by get/getWithoutAck and has not already been acked or rolled back.
- Verify the current active connector has not failed over to another canal server; after failover, re-subscribe and fetch again before rolling back.
- Enable client retry logic (retryTimes/retryInterval) so transient network errors during rollback are retried automatically.
When it happens
Trigger: Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java:237 when the library encounters an invalid state.
Common situations: Rollback failure on a cluster connector. Validate batchId before rollback, guard against stale client state after failover, and log the active node so retries do not silently drop the batch.
AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14).
Data as JSON: /api/errors/d71edc81af77ea78.
Report an issue: GitHub.