grafana/k6 · error

errorText

Error message

errorText

What it means

FrameManager.frameAbortedNavigation (frame_manager.go:104-128) builds a NavigationEvent whose err is the raw errorText received from CDP when the browser aborts a navigation. The text is typically a net::ERR_* code such as net::ERR_CONNECTION_REFUSED, net::ERR_ABORTED or net::ERR_CERT_AUTHORITY_INVALID, and it surfaces to scripts through page.goto()/waitForNavigation() failures and navigation events.

Source

Thrown at internal/js/modules/k6/browser/common/frame_manager.go:124

	if frame.pendingDocument == nil {
		frame.pendingDocumentMu.Unlock()
		return
	}
	if documentID != "" && frame.pendingDocument.documentID != documentID {
		frame.pendingDocumentMu.Unlock()
		return
	}

	m.logger.Debugf("FrameManager:frameAbortedNavigation:emit:EventFrameNavigation",
		"fmid:%d fid:%v err:%s docid:%s fname:%s furl:%s",
		m.ID(), frameID, errorText, documentID, frame.Name(), frame.URL())

	ne := &NavigationEvent{
		url:         frame.URL(),
		name:        frame.Name(),
		newDocument: frame.pendingDocument,
		err:         errors.New(errorText),
	}
	frame.pendingDocument = nil

	frame.pendingDocumentMu.Unlock()

	frame.emit(EventFrameNavigation, ne)
}

func (m *FrameManager) frameAttached(frameID cdp.FrameID, parentFrameID cdp.FrameID) {
	m.logger.Debugf("FrameManager:frameAttached", "fmid:%d fid:%v pfid:%v",
		m.ID(), frameID, parentFrameID)

	m.framesMu.Lock()
	defer m.framesMu.Unlock()

	if _, ok := m.frames[frameID]; ok {
		m.logger.Debugf("FrameManager:frameAttached:return",
			"fmid:%d fid:%v pfid:%v cannot find frame",

View on GitHub (pinned to 93accf6570)

Solutions

  1. Verify the URL opens in a real browser from the same machine/network that runs k6
  2. For TLS issues, create the browser context with ignoreHTTPSErrors: true or import the CA
  3. Configure proxy settings in browser.launch() if the environment requires an egress proxy
  4. Treat downloads differently (don't navigate to them); assert on the specific net::ERR text to distinguish causes

Example fix

// before
await page.goto('https://self-signed.internal.example.com/'); // net::ERR_CERT_AUTHORITY_INVALID

// after
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
await page.goto('https://self-signed.internal.example.com/');
Defensive patterns

Strategy: try-catch

Validate before calling

// Sanity-check reachability before navigating the real browser
const res = await http.get(url);
if (res.status >= 400 || res.error) { /* fix env/proxy/TLS before driving the browser */ }

Try / catch

try {
  await page.goto(url, { waitUntil: 'load' });
} catch (e) {
  const msg = String(e.message || e);
  if (msg.includes('ERR_CONNECTION_REFUSED')) { /* WUT down or wrong port */ }
  else if (msg.includes('ERR_CERT')) { /* retry with ignoreHTTPSErrors context */ }
  else { throw e; }
}

Prevention

When it happens

Trigger: The browser aborts navigation: the system under test is unreachable, DNS fails, TLS verification fails, a new navigation interrupts the current one (net::ERR_ABORTED), or the target is a download rather than a document.

Common situations: Wrong host/port in the script; proxy or firewall blocking the load generator; self-signed certificates without ignoreHTTPSErrors; clicking links that trigger file downloads; redirect storms.

Related errors


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