{"record":{"id":"00933b6cf6e79ae2","repo":"grafana/k6","slug":"file-does-not-exist-s","errorCode":null,"errorMessage":"file does not exist: %s","messagePattern":"file does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/js/modules/k6/browser/common/browser_process.go","lineNumber":177,"sourceCode":"\tdataDir *storage.Dir, logger *log.Logger,\n) (command, error) {\n\tcmd := exec.CommandContext(ctx, path, args...) //nolint:gosec\n\tkillAfterParent(cmd)\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn command{}, fmt.Errorf(\"%w\", err)\n\t}\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn command{}, fmt.Errorf(\"%w\", err)\n\t}\n\n\t// We must start the cmd before calling cmd.Wait, as otherwise the two\n\t// can run into a data race.\n\terr = cmd.Start()\n\tif os.IsNotExist(err) { //nolint:forbidigo\n\t\treturn command{}, fmt.Errorf(\"file does not exist: %s\", path)\n\t}\n\tif err != nil {\n\t\treturn command{}, fmt.Errorf(\"%w\", err)\n\t}\n\tif ctx.Err() != nil {\n\t\treturn command{}, ContextErr(ctx)\n\t}\n\n\tdone := make(chan struct{})\n\tgo func() {\n\t\t// TODO: How to handle these errors?\n\t\tdefer func() {\n\t\t\tif err := dataDir.Cleanup(); err != nil {\n\t\t\t\tlogger.Errorf(\"browser\", \"cleaning up the user data directory: %v\", err)\n\t\t\t}\n\t\t\tclose(done)\n\t\t}()\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/browser_process.go#L159-L195","documentation":"cmd.Start() returned an os.IsNotExist error: the executable k6 tried to launch (the Chromium binary from auto-detection or from K6_BROWSER_EXECUTABLE_PATH / BrowserOptions.ExecutablePath) does not exist at that path. The message echoes the exact path that was tried.","triggerScenarios":"K6_BROWSER_EXECUTABLE_PATH points to a missing binary (typo'd path, binary not installed in the CI image); auto-detected chrome was uninstalled; a headless-shell download directory was moved or cleaned.","commonSituations":"Slim Docker images (alpine/distroless) with no Chrome installed; CI images where Chrome lives at a different path than locally; mounting a volume without the browser; wrong path separators on Windows.","solutions":["Verify the path in the error exists: ls -l <path-from-error>.","Install Chrome/Chromium in the environment, or point K6_BROWSER_EXECUTABLE_PATH at the correct binary.","On CI, prefer an image that ships Chromium or install it in the pipeline before k6 runs."],"exampleFix":"# before\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/chrome   # does not exist\n\n# after\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium-browser\n# or install: apt-get install -y chromium","handlingStrategy":"validation","validationCode":"# verify the browser binary exists before running k6\nP=\"${K6_BROWSER_EXECUTABLE_PATH:-$(command -v chromium || command -v chromium-browser || command -v google-chrome)}\"\n[ -n \"$P\" ] && [ -x \"$P\" ] || { echo \"browser executable missing: '$P'\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"try {\n  await launch();\n} catch (e) {\n  if (/file does not exist/.test(String(e))) {\n    throw new Error('Install Chrome/Chromium or fix K6_BROWSER_EXECUTABLE_PATH');\n  }\n  throw e;\n}","preventionTips":["Use CI images that ship Chromium or install it in the pipeline step before k6.","Pin K6_BROWSER_EXECUTABLE_PATH to a path you have verified with ls -l.","Include a browser-version echo step in CI to catch missing binaries early."],"tags":["browser","executable","installation","ci","configuration"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}