alibaba/canal · error · CanalParseException
[fixed timestamp] can't found begin/commit position before w
Error message
[fixed timestamp] can't found begin/commit position before with fixed position + fixedPosition.getJournalName() + : + fixedPosition.getPosition()
What it means
findPositionWithMasterIdAndTimestamp() uses a far-future timestamp (now + 102 years) to locate the last begin/commit transaction boundary at or before a fixed position when tableMetaTSDB is enabled and the fixed position lacks a timestamp. If findAsPerTimestampInSpecificLogFile returns null (no transaction boundary found in the binlog), Canal throws CanalParseException — it cannot safely resume without a valid transaction anchor.
Source
Thrown at parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java:403
endPosition.getJournalName(),
true);
} else {
return endPosition;
}
}
protected EntryPosition findPositionWithMasterIdAndTimestamp(MysqlConnection connection, EntryPosition fixedPosition) {
MysqlConnection mysqlConnection = (MysqlConnection) connection;
if (tableMetaTSDB != null && (fixedPosition.getTimestamp() == null || fixedPosition.getTimestamp() <= 0)) {
// 使用一个未来极大的时间,基于位点进行定位
long startTimestamp = System.currentTimeMillis() + 102L * 365 * 24 * 3600 * 1000; // 当前时间的未来102年
EntryPosition entryPosition = findAsPerTimestampInSpecificLogFile(mysqlConnection,
startTimestamp,
fixedPosition,
fixedPosition.getJournalName(),
true);
if (entryPosition == null) {
throw new CanalParseException("[fixed timestamp] can't found begin/commit position before with fixed position "
+ fixedPosition.getJournalName() + ":" + fixedPosition.getPosition());
}
return entryPosition;
} else {
return fixedPosition;
}
}
protected EntryPosition findStartPositionInternal(ErosaConnection connection) {
MysqlConnection mysqlConnection = (MysqlConnection) connection;
LogPosition logPosition = logPositionManager.getLatestIndexBy(destination);
if (logPosition == null) {// 找不到历史成功记录
EntryPosition entryPosition = null;
if (masterInfo != null && mysqlConnection.getConnector().getAddress().equals(masterInfo.getAddress())) {
entryPosition = masterPosition;
} else if (standbyInfo != null
&& mysqlConnection.getConnector().getAddress().equals(standbyInfo.getAddress())) {
entryPosition = standbyPosition;View on GitHub (pinned to 87be50e876)
Solutions
- Provide a timestamp on the fixed entry position (canal.instance.master.timestamp) so the far-future scan is bypassed.
- Verify the configured journalName/position still exists on the master (SHOW BINARY LOGS); if purged, reset to a current valid position.
- If tableMetaTSDB is not required, disabling it avoids this code path.
- Use GTID-based positioning to avoid relying on filename/offset/timestamp matching.
Example fix
# before: position without timestamp triggers future-102y scan canal.instance.master.position=mysql-bin.000010:12345 # after: include a timestamp so the scan is skipped canal.instance.master.position=mysql-bin.000010:12345 canal.instance.master.timestamp=1690000000000
Defensive patterns
Strategy: validation
Validate before calling
// Ensure the fixed position has a timestamp or the binlog still exists
if (tableMetaTSDB != null && (fixedPosition.getTimestamp() == null || fixedPosition.getTimestamp() <= 0)) {
if (!binlogExistsOnMaster(connection, fixedPosition.getJournalName())) {
throw new IllegalStateException("Fixed binlog " + fixedPosition.getJournalName() + " not found on master; reset position.");
}
} Prevention
- Always pair a fixed binlog position with a timestamp.
- Verify SHOW BINARY LOGS includes your configured journalName before start.
- Use GTID mode to avoid filename/offset/timestamp fragility.
When it happens
Trigger: tableMetaTSDB is enabled, the configured fixed binlog position has no/zero timestamp, and scanning the target binlog file for a begin/commit event before that position yields nothing.
Common situations: The binlog file named in the fixed position no longer exists or has been purged; the position points past the end of available events; the binlog contains no transaction events in the scanned range; TSDB snapshot/meta inconsistency.
Related errors
- preTransactionStartPosition greater than startPosition from
- Not implement yet
- command : ' + showSql + ' has an error! pls check. you need
- command : ' + showSql + ' has an error!
- position not found!
AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14).
Data as JSON: /api/errors/889c8670a627e803.
Report an issue: GitHub.