grafana/k6 · error
cannot generate new sequence for value %d
Error message
cannot generate new sequence for value %d
What it means
GetNewExecutionSegmentSequenceFromValue could not distribute the given value across the segment sequence — the striping/scaling arithmetic yielded no valid new sequence for that total. An internal consistency guard in ExecutionTuple redistribution (used when rescaling work across a new VU count).
Source
Thrown at lib/execution_segment.go:628
}
// GetNewExecutionSegmentSequenceFromValue uses the value provided, splits it
// between all the segments, using the striping offsets in the sequence,
// generating a new segment sequence. It then returns a new
// ExecutionSegmentSequenceWrapper, with the new sequence and segments, such
// that each new segment in the new sequence has length `Scale(value)/value`
// while keeping the order.
//
// Additionally, the position of a given segment index can be tracked (since
// empty segments are removed), so that you can reconstruct an ExecutionTuple,
// if required. If the segment with the trackedIndex is not part of the new
// sequence, or if a new sequence cannot be generated (for example, for 0
// values), an error will be returned.
func (essw *ExecutionSegmentSequenceWrapper) GetNewExecutionSegmentSequenceFromValue(value int64, trackedIndex int) (
newSequence *ExecutionSegmentSequenceWrapper, newIndex int, err error,
) {
if value < 1 {
return nil, -1, fmt.Errorf("cannot generate new sequence for value %d", value)
}
if value%essw.lcd == 0 { // the value is perfectly divisible so we will get the same tuple
return essw, trackedIndex, nil
}
newIndex = -1
newESS := make(ExecutionSegmentSequence, 0, len(essw.ExecutionSegmentSequence)) // this can be smaller
prev := int64(0)
for i := range essw.ExecutionSegmentSequence {
newValue := essw.ScaleInt64(i, value)
if newValue == 0 {
continue
}
currentES := newExecutionSegment(big.NewRat(prev, value), big.NewRat(prev+newValue, value))
prev += newValue
if i == trackedIndex {View on GitHub (pinned to 01ffac6f24)
Solutions
- Use a value (total VU/iteration count) that can be distributed across the configured segments
- Simplify the execution segment configuration if redistribution keeps failing
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at lib/execution_segment.go:628 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/90ce0518ebe21d5e.
Report an issue: GitHub.