{"record":{"id":"e72993c645b417d9","repo":"alibaba/canal","slug":"position-not-found","errorCode":null,"errorMessage":"position not found!","messagePattern":"position not found!","errorType":"exception","errorClass":"PositionNotFoundException","httpStatus":null,"severity":"critical","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/RdsLocalBinlogEventParser.java","lineNumber":57,"sourceCode":"\n    public RdsLocalBinlogEventParser(){\n    }\n\n    public void start() throws CanalParseException {\n        try {\n            Assert.notNull(accesskey);\n            Assert.notNull(secretkey);\n            Assert.notNull(instanceId);\n            Assert.notNull(url);\n            Assert.notNull(directory);\n\n            if (endTime == null) {\n                endTime = System.currentTimeMillis();\n            }\n\n            EntryPosition entryPosition = findStartPosition(null);\n            if (entryPosition == null) {\n                throw new PositionNotFoundException(\"position not found!\");\n            }\n            Long startTimeInMill = entryPosition.getTimestamp();\n            if (startTimeInMill == null || startTimeInMill <= 0) {\n                throw new PositionNotFoundException(\"position timestamp is empty!\");\n            }\n\n            startTime = startTimeInMill;\n            List<BinlogFile> binlogFiles = RdsBinlogOpenApi.listBinlogFiles(url,\n                accesskey,\n                secretkey,\n                instanceId,\n                new Date(startTime),\n                new Date(endTime));\n            if (binlogFiles.isEmpty()) {\n                throw new CanalParseException(\"start timestamp : \" + startTimeInMill + \" binlog files is empty\");\n            }\n\n            binlogDownloadQueue = new BinlogDownloadQueue(binlogFiles, batchFileSize, directory);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/RdsLocalBinlogEventParser.java#L39-L75","documentation":"Thrown as PositionNotFoundException by RdsLocalBinlogEventParser.start() when findStartPosition(null) returns null — meaning no valid binlog start position could be determined from the configured LogPositionManager. This prevents the parser from knowing where to begin reading RDS binlog backups.","triggerScenarios":"Starting RdsLocalBinlogEventParser when the LogPositionManager (memory, file, or zookeeper-based) has no previously persisted position for this destination, and no default start position is configured. Occurs on first startup or after clearing position data.","commonSituations":"First-time deployment of canal with RDS local binlog mode without a pre-configured start position; the zookeeper position node was deleted; canal meta data was wiped; the destination name changed between restarts so the old position is not found.","solutions":["Set a default EntryPosition with a valid timestamp before starting, or configure the LogPositionManager with a seed position.","Ensure the destination name matches what was previously used so positions can be recovered.","If using Zookeeper/File position manager, verify the position data exists and is readable.","Configure canal.instance.master.timestamp or equivalent to provide a fallback start timestamp."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before starting, ensure a position is available\nEntryPosition pos = logPositionManager.getLatestIndexBy(destination);\nif (pos == null) {\n    // seed a default position with a valid timestamp\n    pos = new EntryPosition();\n    pos.setTimestamp(System.currentTimeMillis() - 86400000L); // yesterday\n    pos.setJournalName(\"mysql-bin.000001\");\n    pos.setPosition(4L);\n    logPositionManager.persistLogPosition(destination, buildLogPosition(pos));\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser.start();\n} catch (PositionNotFoundException e) {\n    if (e.getMessage().contains(\"position not found\")) {\n        // seed a default position and retry\n    }\n}","preventionTips":["Pre-seed the LogPositionManager with a known position before first RDS binlog parse.","Verify the destination name is consistent across restarts.","Use a persistent LogPositionManager (File or Zookeeper) to survive restarts."],"tags":["rds","binlog","position","startup","canal-parse"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}