{"record":{"id":"f5112c3139c20df6","repo":"grafana/k6","slug":"browser-process-shutdown-unexpectedly-before-estab","errorCode":null,"errorMessage":"browser process shutdown unexpectedly before establishing a connection: %w","messagePattern":"browser process shutdown unexpectedly before establishing a connection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/browser_process.go","lineNumber":272,"sourceCode":"\t\tif i := strings.Index(line, \"] \"); i > 0 {\n\t\t\tp.errs = append(p.errs, errors.New(line[i+2:]))\n\t\t}\n\t}\n\n\treturn p.url == \"\"\n}\n\nfunc (p *devToolsURLParser) err() error {\n\tif p.url != \"\" {\n\t\treturn io.EOF\n\t}\n\tif len(p.errs) > 0 {\n\t\treturn p.errs[0]\n\t}\n\n\terr := p.sc.Err()\n\tif errors.Is(err, fs.ErrClosed) {\n\t\treturn fmt.Errorf(\"browser process shutdown unexpectedly before establishing a connection: %w\", err)\n\t}\n\tif err != nil {\n\t\treturn err //nolint:wrapcheck\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":254,"sourceCodeEnd":280,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/browser_process.go#L254-L280","documentation":"While parsing the browser's stderr for the DevTools WebSocket URL, the output stream closed (fs.ErrClosed) before any URL appeared — meaning the browser process exited before establishing a CDP connection. The wrapped error identifies the premature close.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/browser_process.go:272 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check browser stderr/logs for startup failure (bad flags, sandbox, missing libs)","Remove incompatible launch arguments","Test the binary manually with the same flags outside k6"],"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"}