{"record":{"id":"f2c0ef42c61490d0","repo":"grafana/k6","slug":"failed-to-skip-lines-until-line-d-reason-w","errorCode":null,"errorMessage":"failed to skip lines until line %d; reason: %w","messagePattern":"failed to skip lines until line (.+?); reason: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/experimental/csv/reader.go","lineNumber":79,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read the first line; reason: %w\", err)\n\t\t}\n\t\treader.columnNames = header\n\t\treader.currentLine.Add(1)\n\t}\n\n\tif options.SkipFirstLine && (!options.FromLine.Valid || options.FromLine.Int64 == 0) {\n\t\tif _, err := csvParser.Read(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to skip the first line; reason: %w\", err)\n\t\t}\n\n\t\treader.currentLine.Add(1)\n\t}\n\n\tif options.FromLine.Valid && options.FromLine.Int64 > 0 {\n\t\tfor reader.currentLine.Load() < options.FromLine.Int64 {\n\t\t\tif _, err := csvParser.Read(); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to skip lines until line %d; reason: %w\", options.FromLine.Int64, err)\n\t\t\t}\n\t\t\treader.currentLine.Add(1)\n\t\t}\n\t}\n\n\treturn reader, nil\n}\n\n// The csv module's read must implement the RecordReader interface.\nvar _ data.RecordReader = (*Reader)(nil)\n\n// Read reads a record from the CSV file.\n//\n// If the `header` option is enabled, it will return a map of the record.\n// Otherwise, it will return the record as a slice of strings.\nfunc (r *Reader) Read() (any, error) {\n\ttoLineSet := r.options.ToLine.Valid\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/experimental/csv/reader.go#L61-L97","documentation":"Raised in NewReaderFrom when the fromLine option is set above 0 and the reader hits an error (usually io.EOF, meaning the file has fewer lines than requested) while skipping records to reach the starting line.","triggerScenarios":"Thrown at internal/js/modules/k6/experimental/csv/reader.go:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lower fromLine to a line number that exists in the file","Remove fromLine to start from the beginning","Verify the file actually contains at least fromLine data rows"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}