{"record":{"id":"88b52360ddcdea94","repo":"juicedata/juicefs","slug":"invalid-changelog-entry-s","errorCode":null,"errorMessage":"invalid changelog entry: %s","messagePattern":"invalid changelog entry: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/base.go","lineNumber":1088,"sourceCode":"\t\t\t\tm.bgjobDuration.WithLabelValues(\"cleanupSlices\", status).Observe(time.Since(jobStart).Seconds())\n\t\t\t\tm.bgjobDels.WithLabelValues(\"cleanupSlices\").Add(float64(cnt))\n\t\t\t}()\n\t\t}\n\t}\n}\n\nfunc (m *baseMeta) CleanupSlices(ctx Context) syscall.Errno {\n\treturn errno(m.en.doCleanupSlices(ctx, nil))\n}\n\nfunc (m *baseMeta) WaitDeleteSlices() {\n\tm.stopDeleteSliceTasks()\n}\n\nfunc parseChangelogTime(entry string) (time.Time, error) {\n\tidx := strings.IndexByte(entry, '|')\n\tif idx < 0 {\n\t\treturn time.Time{}, fmt.Errorf(\"invalid changelog entry: %s\", entry)\n\t}\n\ttimePart := entry[:idx]\n\tdotIdx := strings.IndexByte(timePart, '.')\n\tif dotIdx < 0 {\n\t\tsec, err := strconv.ParseInt(timePart, 10, 64)\n\t\tif err != nil {\n\t\t\treturn time.Time{}, err\n\t\t}\n\t\treturn time.Unix(sec, 0), nil\n\t}\n\tsec, err := strconv.ParseInt(timePart[:dotIdx], 10, 64)\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tnsec, err := strconv.ParseInt(timePart[dotIdx+1:], 10, 64)\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}","sourceCodeStart":1070,"sourceCodeEnd":1106,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/base.go#L1070-L1106","documentation":"parseChangelogTime parses a changelog entry expected to start with '<unix-time>|'; if the entry contains no '|' separator, the entry is malformed and this error is returned. It guards changelog replay/parsing against corrupt or foreign entries.","triggerScenarios":"Replaying a changelog (e.g. during Redis AOF-based recovery or kv changelog processing) where an entry lost its timestamp prefix; manual edits or truncation of the changelog stream.","commonSituations":"Corrupted Redis AOF / changelog keys; entries written by incompatible tooling; partially rotated or hand-trimmed changelog logs.","solutions":["Inspect the malformed entry and repair or remove it from the changelog","Restore the changelog from a backup or snapshot and replay from a consistent point","Check the writer path for corruption (disk full, truncation) before replaying again"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func validChangelogEntry(e string) bool { i := strings.IndexByte(e, '|'); return i > 0 && isDigits(e[:i]) }","typeGuard":null,"tryCatchPattern":"if _, err := parseChangelogTime(entry); err != nil { log.Warnf(\"skipping malformed changelog entry: %v\", err); continue }","preventionTips":["Do not hand-edit or truncate changelog streams","Take snapshots/backups before touching changelog storage","Monitor disk space on metadata hosts to avoid truncated writes"],"tags":["changelog","parsing","corruption"],"backgroundTag":"invalid-argument-format","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}