{"record":{"id":"d0bdbca9246e3038","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-request-q-has-empty-provider","errorCode":null,"errorMessage":"cachebench: replay request %q has empty provider","messagePattern":"cachebench: replay request %q has empty provider","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":451,"sourceCode":"\t\tInputBudgetClaimedProviderCounted: len(tokenBases) == 1 && tokenBases[0] == TokenProviderCounted,\n\t\tMaxConcurrency:                    limits.MaxConcurrency,\n\t}, nil\n}\n\n// ValidateReplayTarget rejects a live population that cannot meet its minimum\n// sample gate even if every captured request proves cache eligible.\nfunc ValidateReplayTarget(records []TraceRecord, target Target) error {\n\tif err := validateTarget(target); err != nil {\n\t\treturn err\n\t}\n\tif len(records) == 0 {\n\t\treturn errors.New(\"cachebench: replay trace is empty\")\n\t}\n\tcounts := map[string]int{}\n\tfor _, record := range records {\n\t\tprovider := strings.ToLower(strings.TrimSpace(record.Provider))\n\t\tif provider == \"\" {\n\t\t\treturn fmt.Errorf(\"cachebench: replay request %q has empty provider\", record.RequestID)\n\t\t}\n\t\tcounts[provider]++\n\t}\n\tfor provider, count := range counts {\n\t\tif count < target.MinEligibleRequest {\n\t\t\treturn fmt.Errorf(\"cachebench: provider %q population %d cannot meet minimum eligible requests %d\", provider, count, target.MinEligibleRequest)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Run validates full population, prepares equivalent bodies, then dispatches replay.\nfunc (runner ReplayRunner) Run(ctx context.Context, records []TraceRecord, emit func(ReplayResult) error) error {\n\tif runner.Engine == nil || runner.Transport == nil || runner.Verifier == nil || emit == nil {\n\t\treturn errors.New(\"cachebench: replay engine, transport, verifier, and emitter required\")\n\t}\n\tif _, err := ValidateReplay(records, runner.Limits, runner.TimeScale); err != nil {\n\t\treturn err","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay.go#L433-L469","documentation":"While counting provider populations in ValidateReplayTarget, a trace record carried an empty provider string. Eligibility gating groups requests by provider, so a request without a provider cannot be classified.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:451 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Populate provider on every trace record at capture time","Default the provider from the endpoint configuration when exporting"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}