{"record":{"id":"f4ab0edaf7c2d1f1","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-trace-is-empty","errorCode":null,"errorMessage":"cachebench: replay trace is empty","messagePattern":"cachebench: replay trace is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":357,"sourceCode":"\n// ReplayRunner performs prevalidated absolute-time live replay.\ntype ReplayRunner struct {\n\tEngine    *cacheengine.Engine\n\tTransport ReplayTransport\n\tVerifier  ReplayVerifier\n\tLimits    ReplayLimits\n\t// Target enables a post-engine eligible-population gate before any provider\n\t// call. Nil leaves target evaluation to caller.\n\tTarget    *Target\n\tTimeScale float64\n\tNow       func() time.Time\n\tSleep     func(context.Context, time.Duration) error\n}\n\n// ValidateReplay performs zero-network trace, schedule, and budget preflight.\nfunc ValidateReplay(records []TraceRecord, limits ReplayLimits, timeScale float64) (ReplayPreflight, error) {\n\tif len(records) == 0 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: replay trace is empty\")\n\t}\n\tif limits.MaxRequests <= 0 || limits.MaxDeclaredBilledTokens <= 0 || limits.MaxGap <= 0 || limits.MaxScheduleDrift <= 0 || limits.MaxConcurrency <= 0 || limits.MaxConcurrency > 1024 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: positive replay request, token, gap, schedule-drift, and concurrency limits required; concurrency cannot exceed 1024\")\n\t}\n\tif len(records) > limits.MaxRequests {\n\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay population %d exceeds request limit %d\", len(records), limits.MaxRequests)\n\t}\n\tif timeScale <= 0 || math.IsNaN(timeScale) || math.IsInf(timeScale, 0) || timeScale > 1000 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: time scale must be greater than zero and at most 1000\")\n\t}\n\tseen := make(map[string]bool, len(records))\n\ttiming := map[string]bool{}\n\ttokens := map[string]bool{}\n\tvar previous time.Time\n\tvar declaredInput, declaredOutput, worstCase, scheduled int64\n\tfor index, record := range records {\n\t\tif seen[record.RequestID] {\n\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: duplicate replay request %q\", record.RequestID)","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/replay.go#L339-L375","documentation":"Error \"cachebench: replay trace is empty\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty replay trace."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}