JuliusBrussee/caveman · error

cachebench: replay request

Error message

cachebench: replay request %q has empty provider

What it means

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.

Solutions

  1. Populate provider on every trace record at capture time
  2. Default the provider from the endpoint configuration when exporting
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cacheengine/cachebench/replay.go:451 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/d0bdbca9246e3038. Report an issue: GitHub.

Appendix: source

Thrown at cacheengine/cachebench/replay.go:451

		InputBudgetClaimedProviderCounted: len(tokenBases) == 1 && tokenBases[0] == TokenProviderCounted,
		MaxConcurrency:                    limits.MaxConcurrency,
	}, nil
}

// ValidateReplayTarget rejects a live population that cannot meet its minimum
// sample gate even if every captured request proves cache eligible.
func ValidateReplayTarget(records []TraceRecord, target Target) error {
	if err := validateTarget(target); err != nil {
		return err
	}
	if len(records) == 0 {
		return errors.New("cachebench: replay trace is empty")
	}
	counts := map[string]int{}
	for _, record := range records {
		provider := strings.ToLower(strings.TrimSpace(record.Provider))
		if provider == "" {
			return fmt.Errorf("cachebench: replay request %q has empty provider", record.RequestID)
		}
		counts[provider]++
	}
	for provider, count := range counts {
		if count < target.MinEligibleRequest {
			return fmt.Errorf("cachebench: provider %q population %d cannot meet minimum eligible requests %d", provider, count, target.MinEligibleRequest)
		}
	}
	return nil
}

// Run validates full population, prepares equivalent bodies, then dispatches replay.
func (runner ReplayRunner) Run(ctx context.Context, records []TraceRecord, emit func(ReplayResult) error) error {
	if runner.Engine == nil || runner.Transport == nil || runner.Verifier == nil || emit == nil {
		return errors.New("cachebench: replay engine, transport, verifier, and emitter required")
	}
	if _, err := ValidateReplay(records, runner.Limits, runner.TimeScale); err != nil {
		return err

View on GitHub (pinned to 766dce6b13)