apache/cassandra · error · RuntimeException

Unable to parse creation time from

Error message

Unable to parse creation time from 

What it means

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.

Solutions

  1. Inspect the snapshot's creation-time file and rewrite it with the epoch-milliseconds integer (e.g. 1700000000000).
  2. Remove or regenerate the corrupt snapshot metadata; retake the snapshot if integrity is in doubt.
  3. Exclude corrupted snapshot directories from loaders/restore tooling until fixed.
  4. In tooling, wrap snapshot loading in try-catch and skip snapshots with unparseable metadata, logging the directory.

Example fix

// before
echo "2024-01-01" > snapshot/ks1/table/1608616002784/manifests/creation-time
// after
echo "1704067200000" > snapshot/ks1/table/1608616002784/manifests/creation-time
Defensive patterns

Strategy: validation

Validate before calling

boolean isValidCreationTime(String s) { try { Long.parseLong(s.trim()); return true; } catch (NumberFormatException | NullPointerException e) { return false; } }

Try / catch

try { loadSnapshots(dir); } catch (RuntimeException e) { if (e.getMessage().startsWith("Unable to parse creation time")) { skipAndLog(dir); } else throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: Snapshots copied/restored by external tools that mangled metadata files; snapshots produced by different Cassandra versions or third-party tooling; partially failed snapshot writes.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/7651c05ce2934afd. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/snapshot/SnapshotOptions.java:160

        }

        public Builder ttl(DurationSpec.IntSecondsBound ttl)
        {
            this.ttl = ttl;
            return this;
        }

        public Builder creationTime(String creationTime)
        {
            if (creationTime != null)
            {
                try
                {
                    return creationTime(Long.parseLong(creationTime));
                }
                catch (Exception ex)
                {
                    throw new RuntimeException("Unable to parse creation time from " + creationTime);
                }
            }

            return this;
        }

        public Builder creationTime(Instant creationTime)
        {
            this.creationTime = creationTime;
            return this;
        }

        public Builder creationTime(long creationTime)
        {
            return creationTime(Instant.ofEpochMilli(creationTime));
        }

        public Builder skipFlush()

View on GitHub (pinned to 88fd0f6a0e)