{"record":{"id":"7651c05ce2934afd","repo":"apache/cassandra","slug":"unable-to-parse-creation-time-from","errorCode":null,"errorMessage":"Unable to parse creation time from ","messagePattern":"Unable to parse creation time from ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/snapshot/SnapshotOptions.java","lineNumber":160,"sourceCode":"        }\n\n        public Builder ttl(DurationSpec.IntSecondsBound ttl)\n        {\n            this.ttl = ttl;\n            return this;\n        }\n\n        public Builder creationTime(String creationTime)\n        {\n            if (creationTime != null)\n            {\n                try\n                {\n                    return creationTime(Long.parseLong(creationTime));\n                }\n                catch (Exception ex)\n                {\n                    throw new RuntimeException(\"Unable to parse creation time from \" + creationTime);\n                }\n            }\n\n            return this;\n        }\n\n        public Builder creationTime(Instant creationTime)\n        {\n            this.creationTime = creationTime;\n            return this;\n        }\n\n        public Builder creationTime(long creationTime)\n        {\n            return creationTime(Instant.ofEpochMilli(creationTime));\n        }\n\n        public Builder skipFlush()","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/snapshot/SnapshotOptions.java#L142-L178","documentation":"SnapshotOptions.creationTime tries Long.parseLong on the snapshot directory's creation-time file and throws a RuntimeException if the contents are not a plain integer. It guards against corrupt or hand-edited snapshot metadata.","triggerScenarios":"Loading a snapshot whose creation-time property file contains a non-numeric value (truncated write, manual edit, wrong epoch format like '2024-01-01' or trailing newline handled elsewhere but text like 'N/A' present).","commonSituations":"Snapshots copied/restored by external tools that mangled metadata files; snapshots produced by different Cassandra versions or third-party tooling; partially failed snapshot writes.","solutions":["Inspect the snapshot's creation-time file and rewrite it with the epoch-milliseconds integer (e.g. 1700000000000).","Remove or regenerate the corrupt snapshot metadata; retake the snapshot if integrity is in doubt.","Exclude corrupted snapshot directories from loaders/restore tooling until fixed.","In tooling, wrap snapshot loading in try-catch and skip snapshots with unparseable metadata, logging the directory."],"exampleFix":"// before\necho \"2024-01-01\" > snapshot/ks1/table/1608616002784/manifests/creation-time\n// after\necho \"1704067200000\" > snapshot/ks1/table/1608616002784/manifests/creation-time","handlingStrategy":"validation","validationCode":"boolean isValidCreationTime(String s) { try { Long.parseLong(s.trim()); return true; } catch (NumberFormatException | NullPointerException e) { return false; } }","typeGuard":null,"tryCatchPattern":"try { loadSnapshots(dir); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Unable to parse creation time\")) { skipAndLog(dir); } else throw e; }","preventionTips":["Never hand-edit snapshot metadata files","Use Cassandra-native tooling to copy/restore snapshots","Validate metadata files after external snapshot moves"],"tags":["snapshot","metadata","parse-error","corruption"],"backgroundTag":"invalid-argument-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"}