grafana/k6 · critical
getting browser version information: %w
Error message
getting browser version information: %w
What it means
During browser startup, fetchVersion (browser.go:809) issues the CDP Browser.getVersion call to record protocol version, product, revision, user agent and JS engine version. If that first round-trip fails, browser initialization aborts with this wrapped error. The underlying cause is almost always a broken CDP connection or a chromium binary that launched but immediately died or cannot be talked to.
Source
Thrown at internal/js/modules/k6/browser/common/browser.go:809
product := b.version.product
_, after, ok := strings.Cut(product, "/")
if !ok {
return product
}
return after
}
// fetchVersion returns the browser version information.
func (b *Browser) fetchVersion() (browserVersion, error) {
var (
bv browserVersion
err error
)
bv.protocolVersion, bv.product, bv.revision, bv.userAgent, bv.jsVersion, err = cdpbrowser.
GetVersion().
Do(cdp.WithExecutor(b.vuCtx, b.conn))
if err != nil {
return browserVersion{}, fmt.Errorf("getting browser version information: %w", err)
}
// Adjust the user agent to remove the headless part.
//
// Including Headless might cause issues with some websites that treat headless
// browsers differently. Later on, [BrowserContext] will set the user agent to
// this user agent if not set by the user. This will force [FrameSession] to
// set the user agent to the browser's user agent.
//
// Doing this here provides a consistent user agent across all browser contexts.
// Also, it makes it consistent to query the user agent from the browser.
if b.browserOpts.Headless {
bv.userAgent = strings.ReplaceAll(bv.userAgent, "Headless", "")
}
return bv, nil
}
View on GitHub (pinned to 93accf6570)
Solutions
- Verify the binary launches: run "$K6_BROWSER_EXECUTABLE_PATH" --headless --dump-dom about:blank manually and fix whatever fails
- Use the grafana/k6 browser image (or install chromium deps); if running as root, pass --no-sandbox via browser launch args
- Set K6_BROWSER_LOG=debug to capture the wrapped CDP error text and act on it
- Match the chromium version to the one bundled/tested for your k6 release
Defensive patterns
Strategy: validation
Validate before calling
// preflight before the run: verify chromium launches in your image // "$K6_BROWSER_EXECUTABLE_PATH" --headless --dump-dom about:blank >/dev/null && echo ok
Prevention
- Use the grafana/k6 browser image or install all chromium dependencies
- Verify K6_BROWSER_EXECUTABLE_PATH manually before the first run
- Running as root requires --no-sandbox launch args
When it happens
Trigger: chromium crashing right after launch (missing shared libraries, sandbox refusal when running as root, bad K6_BROWSER_EXECUTABLE_PATH); the DevTools websocket handshake failing; severe protocol/version skew with an incompatible chromium build.
Common situations: Running the browser module in a minimal image missing chromium dependencies instead of the grafana/k6 browser image; K6_BROWSER_EXECUTABLE_PATH pointing at a wrong or ancient binary; running as root without --no-sandbox; system Chrome updated ahead of k6's supported range.
Related errors
- WebSocket endpoint cannot be empty
- creating a new blank page: %w
- both K6_CLOUD_METRICS_PUSH_URL and K6_CLOUD_TEST_RUN_TOKEN m
- K6_CLOUD_LOGS_PUSH_URL requires K6_CLOUD_TEST_RUN_TOKEN
- missing required url
AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15).
Data as JSON: /api/errors/723f7b2cc6bff4ba.
Report an issue: GitHub.