{"record":{"id":"a26d86cb0cd72939","repo":"apache/cassandra","slug":"unable-to-parse-restore-target-time","errorCode":null,"errorMessage":"Unable to parse restore target time","messagePattern":"Unable to parse restore target time","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java","lineNumber":171,"sourceCode":"        {\n            throw new RuntimeException(\"Unable to parse precision of value \" + precisionPropertyValue, ex);\n        }\n        if (precision == TimeUnit.NANOSECONDS)\n            throw new RuntimeException(\"NANOSECONDS level precision is not supported.\");\n\n        String targetTime = commitlogCommands.getProperty(\"restore_point_in_time\");\n        long restorePointInTime = Long.MAX_VALUE;\n        try\n        {\n            if (!Strings.isNullOrEmpty(targetTime))\n            {\n                // get restorePointInTime in microseconds level by default as cassandra use this level's timestamp\n                restorePointInTime = getRestorationPointInTimeInMicroseconds(targetTime);\n            }\n        }\n        catch (DateTimeParseException e)\n        {\n            throw new RuntimeException(\"Unable to parse restore target time\", e);\n        }\n\n        String snapshotPosition = commitlogCommands.getProperty(\"snapshot_commitlog_position\");\n        CommitLogPosition snapshotCommitLogPosition;\n        try\n        {\n\n            snapshotCommitLogPosition = Strings.isNullOrEmpty(snapshotPosition)\n                                        ? CommitLogPosition.NONE\n                                        : CommitLogPosition.serializer.fromString(snapshotPosition);\n        }\n        catch (ParseException | NumberFormatException e)\n        {\n            throw new RuntimeException(\"Unable to parse snapshot commit log position\", e);\n        }\n\n        return new CommitLogArchiver(archiveCommand,\n                                     restoreCommand,","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java#L153-L189","documentation":"Thrown when the 'restore_point_in_time' property in commitlog_archiving.properties cannot be parsed as a date-time string. Cassandra parses it with a DateTimeParseException wrapper, so the string must be in a format accepted by its time parser (ISO-8601 style).","triggerScenarios":"getArchiverFromProperties() reads a non-empty restore_point_in_time value (e.g. '2024/01/15 10:00:00' or 'yesterday') and getRestorationPointInTimeInMicroseconds throws DateTimeParseException.","commonSituations":"Locale-specific date formats; human-readable values like 'yesterday'; missing timezone offset where one is required; typos such as single-digit months without the expected pattern.","solutions":["Use an ISO-8601 timestamp, e.g. restore_point_in_time: 2024-01-15T10:00:00+00:00 (or the format documented for your Cassandra version).","Remove the property (restore will use Long.MAX_VALUE, i.e. restore everything available).","Validate the timestamp by parsing it with java.time (OffsetDateTime/DateTimeFormatter) before deployment.","Check the chained DateTimeParseException message to see exactly which part failed to parse."],"exampleFix":"# before\nrestore_point_in_time: 15/01/2024 10:00 AM\n# after\nrestore_point_in_time: 2024-01-15T10:00:00,000Z","handlingStrategy":"validation","validationCode":"String t = props.getProperty(\"restore_point_in_time\");\nif (t != null && !t.isEmpty())\n    OffsetDateTime.parse(t.trim()); // throws DateTimeFormatException early if invalid","typeGuard":null,"tryCatchPattern":"try { archiver = CommitLogArchiver.construct(); }\ncatch (RuntimeException e) {\n    if (\"Unable to parse restore target time\".equals(e.getMessage()))\n        log.error(\"Use ISO-8601 format, e.g. 2024-01-15T10:00:00,000Z\", e);\n    throw e;\n}","preventionTips":["Generate timestamps programmatically (DateTimeFormatter.ISO_OFFSET_DATE_TIME) instead of hand-writing them","Test-parse the configured value in a pre-start check","Document the exact expected format for operators"],"tags":["cassandra","commitlog","configuration","date-parsing"],"backgroundTag":"invalid-date-format","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}