{"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/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/chromium/browser_type.go#L332-L368","documentation":"ErrChromeNotFoundAtPath is the counterpart of ErrChromeNotInstalled for the explicit case: you configured an executable path (executablePath browser option or K6_BROWSER_EXECUTABLE_PATH), and the browser-type code failed to locate/execute a browser binary at that path (trimmed non-empty triggers the path branch in executablePath).","triggerScenarios":"A typo or wrong path in K6_BROWSER_EXECUTABLE_PATH; a relative path that resolves differently under k6's working directory; a path that exists but lacks the executable bit; pointing at a wrapper script or directory instead of the Chrome binary; container path differing from the host path.","commonSituations":"Docker volume-mounts mapping Chrome to a different path than expected; CI templates hardcoding /usr/bin/google-chrome on images where it is /usr/bin/chromium; scripts written on macOS reused on Linux; binaries installed per-user under ~/.local.","solutions":["Use an absolute path and verify it: ls -l /usr/bin/chromium && /usr/bin/chromium --version — the binary must run standalone","Fix the path: K6_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium (or the correct path in your image)","If the file exists but is not executable: chmod +x <path>","Clear the env var to fall back to k6's default system-wide detection"],"exampleFix":"# before\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome  # wrong for this image\n\n# after\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium\n/usr/bin/chromium --version  # sanity check","handlingStrategy":"validation","validationCode":"#!/bin/sh\np=\"${K6_BROWSER_EXECUTABLE_PATH:-}\"\n[ -n \"$p\" ] || exit 0   # not configured, default detection applies\n[ -x \"$p\" ] || { echo \"browser executable not usable at $p\" >&2; exit 1; }\n\"$p\" --version >/dev/null 2>&1 || { echo \"browser at $p fails to run\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use absolute paths for K6_BROWSER_EXECUTABLE_PATH — k6 resolves relative paths from its own working directory","Verify the path once in the Dockerfile/CI script: RUN /usr/bin/chromium --version","Derive the path in the image (symlink to /usr/bin/chromium) so scripts stay image-agnostic"],"tags":["browser","chrome","executable-path","environment","configuration"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}