{"record":{"id":"39bb03835db4ad29","repo":"grafana/k6","slug":"the-start-value-s-of-segment-d-must-be-equal-to","errorCode":null,"errorMessage":"the start value %s of segment #%d must be equal to the end value of the previous one, but it is %s","messagePattern":"the start value (.+?) of segment #(.+?) must be equal to the end value of the previous one, but it is (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/execution_segment.go","lineNumber":310,"sourceCode":"\treturn new(big.Rat).Mul(value, es.length)\n}\n\n// ExecutionSegmentSequence represents an ordered chain of execution segments,\n// where the end of one segment is the beginning of the next. It can serialized\n// as a comma-separated string of rational numbers \"r1,r2,r3,...,rn\", which\n// represents the sequence (r1, r2], (r2, r3], (r3, r4], ..., (r{n-1}, rn].\n// The empty value should be treated as if there is a single (0, 1] segment.\ntype ExecutionSegmentSequence []*ExecutionSegment\n\n// NewExecutionSegmentSequence validates the that the supplied execution\n// segments are non-overlapping and without gaps. It will return a new execution\n// segment sequence if that is true, and an error if it's not.\nfunc NewExecutionSegmentSequence(segments ...*ExecutionSegment) (ExecutionSegmentSequence, error) {\n\tif len(segments) > 1 {\n\t\tto := segments[0].to\n\t\tfor i, segment := range segments[1:] {\n\t\t\tif segment.from.Cmp(to) != 0 {\n\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\"the start value %s of segment #%d must be equal to the end value of the previous one, but it is %s\",\n\t\t\t\t\tsegment.from, i+1, to,\n\t\t\t\t)\n\t\t\t}\n\t\t\tto = segment.to\n\t\t}\n\t}\n\treturn ExecutionSegmentSequence(segments), nil\n}\n\n// NewExecutionSegmentSequenceFromString parses strings of the format\n// \"r1,r2,r3,...,rn\", which represents the sequences like (r1, r2], (r2, r3],\n// (r3, r4], ..., (r{n-1}, rn].\nfunc NewExecutionSegmentSequenceFromString(strSeq string) (ExecutionSegmentSequence, error) {\n\tif len(strSeq) == 0 {\n\t\treturn nil, nil\n\t}\n","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/execution_segment.go#L292-L328","documentation":"NewExecutionSegmentSequence found a gap or overlap: a segment's start does not equal the previous segment's end. A valid sequence must be contiguous (the end of one segment is exactly the beginning of the next), so non-adjacent bounds are rejected.","triggerScenarios":"Thrown at lib/execution_segment.go:310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make consecutive segments share boundaries, e.g. 0:1/3,1/3:2/3,2/3:1","Verify every internal point appears exactly twice in the sequence string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}