{"record":{"id":"69ee079592973e86","repo":"grafana/k6","slug":"k6-couldn-t-detect-google-chrome-or-a-chromium-sup-69ee07","errorCode":null,"errorMessage":"k6 couldn't detect google chrome or a chromium-supported browser on the given path","messagePattern":"k6 couldn't detect google chrome or a chromium-supported browser on the given path","errorType":"exception","errorClass":"ErrChromeNotFoundAtPath","httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/chromium/browser_type.go","lineNumber":350,"sourceCode":"\t\t}\n\t}()\n\n\targs, err := parseArgs(flags)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn common.NewLocalBrowserProcess(bProcCtx, path, args, dataDir, bProcCtxCancel, logger) //nolint: wrapcheck\n}\n\nvar (\n\t// ErrChromeNotInstalled is returned when the Chrome executable is not found.\n\tErrChromeNotInstalled = errors.New(\n\t\t\"k6 couldn't detect google chrome or a chromium-supported browser on this system\",\n\t)\n\n\t// ErrChromeNotFoundAtPath is returned when the Chrome executable is not found at the given path.\n\tErrChromeNotFoundAtPath = errors.New(\n\t\t\"k6 couldn't detect google chrome or a chromium-supported browser on the given path\",\n\t)\n)\n\n// executablePath returns the path where the extension expects to find the browser executable.\nfunc executablePath(\n\tpath string,\n\tenv env.LookupFunc,\n\tlookPath func(file string) (string, error), // os.LookPath\n) (string, error) {\n\t// find the browser executable in the user provided path\n\tif path := strings.TrimSpace(path); path != \"\" {\n\t\tif _, err := lookPath(path); err == nil {\n\t\t\treturn path, nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"%w: %s\", ErrChromeNotFoundAtPath, path)\n\t}\n","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/chromium/browser_type.go#L332-L368","documentation":"Variant of the executable lookup failure where you explicitly configured a path: executablePath trims the user-supplied value and checks it, returning ErrChromeNotFoundAtPath (chromium/browser_type.go:350) when the given path does not exist as a usable executable. k6 never falls back to autodetection once a path is provided, so the path must be correct.","triggerScenarios":"Setting K6_BROWSER_PATH (or execPath) to a nonexistent path, a typo'd path, a directory, a non-executable file, or a path that exists on the host but not inside the container (missing volume mount / different mount namespace).","commonSituations":"Docker/k6 containers where the Chrome mount is missing or mounted at a different path; macOS host paths (/Applications/...) reused in Linux CI; spaces or unexpanded ~ in the path; binaries copied without the execute bit.","solutions":["Verify the path exists inside the environment k6 runs in: ls -l /usr/bin/chromium","Use an absolute path with no spaces or shell expansions; avoid ~","Ensure the file is executable: chmod +x /path/to/chrome","In containers, double-check the volume mount and that the path is the binary itself, not its directory"],"exampleFix":"# before\nK6_BROWSER_PATH=/usr/local/bin/chrome k6 run script.js  # file not there in container\n\n# after\ndocker run -v /opt/chrome:/opt/chrome:ro -e K6_BROWSER_PATH=/opt/chrome/chrome grafana/k6 run - < script.js","handlingStrategy":"validation","validationCode":"# verify the configured executable before the run\nK6_BROWSER_PATH=\"${K6_BROWSER_PATH:-/usr/bin/chromium}\"\n[ -x \"$K6_BROWSER_PATH\" ] || { echo \"$K6_BROWSER_PATH is not an executable file\" >&2; exit 1; }\nk6 run script.js","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute executable paths (the binary itself, not its directory) without ~ or spaces","In containers, verify the volume mount exists before the run: ls -l /opt/chrome/chrome","chmod +x binaries copied into images","Keep host and container browser paths in one shared env file to avoid drift"],"tags":["browser","environment","chrome","chromium","path-configuration","docker"],"backgroundTag":"browser-executable-not-found","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}