JuliusBrussee/caveman · error

cachebench: duplicate replay request %q

Error message

cachebench: duplicate replay request %q

What it means

Error "cachebench: duplicate replay request %q" thrown in JuliusBrussee/caveman.

Source

Thrown at cacheengine/cachebench/replay.go:375

		return ReplayPreflight{}, errors.New("cachebench: replay trace is empty")
	}
	if limits.MaxRequests <= 0 || limits.MaxDeclaredBilledTokens <= 0 || limits.MaxGap <= 0 || limits.MaxScheduleDrift <= 0 || limits.MaxConcurrency <= 0 || limits.MaxConcurrency > 1024 {
		return ReplayPreflight{}, errors.New("cachebench: positive replay request, token, gap, schedule-drift, and concurrency limits required; concurrency cannot exceed 1024")
	}
	if len(records) > limits.MaxRequests {
		return ReplayPreflight{}, fmt.Errorf("cachebench: replay population %d exceeds request limit %d", len(records), limits.MaxRequests)
	}
	if timeScale <= 0 || math.IsNaN(timeScale) || math.IsInf(timeScale, 0) || timeScale > 1000 {
		return ReplayPreflight{}, errors.New("cachebench: time scale must be greater than zero and at most 1000")
	}
	seen := make(map[string]bool, len(records))
	timing := map[string]bool{}
	tokens := map[string]bool{}
	var previous time.Time
	var declaredInput, declaredOutput, worstCase, scheduled int64
	for index, record := range records {
		if seen[record.RequestID] {
			return ReplayPreflight{}, fmt.Errorf("cachebench: duplicate replay request %q", record.RequestID)
		}
		seen[record.RequestID] = true
		if record.Schema != TraceSchema {
			return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q needs %s billed-token metadata", record.RequestID, TraceSchema)
		}
		if _, err := record.NativeRequest(); err != nil {
			return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %d: %w", index, err)
		}
		at, err := time.Parse(time.RFC3339Nano, record.At)
		if err != nil || !previous.IsZero() && at.Before(previous) {
			return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q has invalid time order", record.RequestID)
		}
		if limits.RequireGroundedTiming && record.TimingBasis != TimingGrounded {
			return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q timing basis %q is not globally grounded", record.RequestID, record.TimingBasis)
		}
		timing[record.TimingBasis] = true
		if limits.RequireProviderTokens && record.TokenBasis != TokenProviderCounted {
			return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q token basis %q is not provider-counted", record.RequestID, record.TokenBasis)

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Remove the duplicate replay request id.

When it happens

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

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/f7d5521d4ef7386e. Report an issue: GitHub.