{"record":{"id":"3d1083ad7a3ff059","repo":"grafana/k6","slug":"provided-segment-s-can-t-be-found-in-sequence-s","errorCode":null,"errorMessage":"provided segment %s can't be found in sequence %s","messagePattern":"provided segment (.+?) can't be found in sequence (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/options.go","lineNumber":540,"sourceCode":"\t\to.DNS.Policy = opts.DNS.Policy\n\t}\n\n\treturn o\n}\n\n// Validate checks if all of the specified options make sense\nfunc (o Options) Validate() []error {\n\t// TODO: validate all of the other options... that we should have already been validating...\n\t// TODO: maybe integrate an external validation lib: https://github.com/avelino/awesome-go#validation\n\tvar validationErrors []error\n\tif o.ExecutionSegmentSequence != nil {\n\t\tvar segmentFound bool\n\t\tif slices.ContainsFunc(*o.ExecutionSegmentSequence, o.ExecutionSegment.Equal) {\n\t\t\tsegmentFound = true\n\t\t}\n\t\tif !segmentFound {\n\t\t\tvalidationErrors = append(validationErrors,\n\t\t\t\tfmt.Errorf(\"provided segment %s can't be found in sequence %s\",\n\t\t\t\t\to.ExecutionSegment, o.ExecutionSegmentSequence))\n\t\t}\n\t}\n\tvalidationErrors = append(validationErrors, o.Scenarios.Validate()...)\n\n\t// Duration\n\tif o.SetupTimeout.Valid && o.SetupTimeout.Duration <= 0 {\n\t\tvalidationErrors = append(validationErrors, errors.New(\"setupTimeout must be positive\"))\n\t}\n\treturn validationErrors\n}\n\n// ForEachSpecified enumerates all struct fields and calls the supplied function with each\n// element that is valid. It panics for any unfamiliar or unexpected fields, so make sure\n// new fields in Options are accounted for.\nfunc (o Options) ForEachSpecified(structTag string, callback func(key string, value any)) {\n\tstructType := reflect.TypeFor[Options]()\n\tstructVal := reflect.ValueOf(o)","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/options.go#L522-L558","documentation":"Raised by Options.Validate when an execution segment is configured (via K6_EXECUTION_SEGMENT) but that segment is not part of the specified execution segment sequence (K6_EXECUTION_SEGMENT_SEQUENCE), so the segment's boundaries are undefined for this run.","triggerScenarios":"Thrown at lib/options.go:540 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a segment that appears in the configured sequence (e.g. 0:1/3 within 0:1/3,1/3:2/3,2/3:1:0)","Ensure the sequence string is valid and complete so the segment can be found"],"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"}