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

  1. Verify the binary launches: run "$K6_BROWSER_EXECUTABLE_PATH" --headless --dump-dom about:blank manually and fix whatever fails
  2. Use the grafana/k6 browser image (or install chromium deps); if running as root, pass --no-sandbox via browser launch args
  3. Set K6_BROWSER_LOG=debug to capture the wrapped CDP error text and act on it
  4. 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

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


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/723f7b2cc6bff4ba. Report an issue: GitHub.