{"record":{"id":"652a9a068315e6e4","repo":"grafana/k6","slug":"initializing-networking-t-w","errorCode":null,"errorMessage":"initializing networking %T: %w","messagePattern":"initializing networking %T: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/network_manager.go","lineNumber":376,"sourceCode":"\n\tm.eventInterceptor.onResponse(resp)\n\tm.eventInterceptor.onRequestFinished(req)\n\tm.emit(cdproto.EventNetworkResponseReceived, resp)\n\tm.emit(cdproto.EventNetworkLoadingFinished, req)\n}\n\nfunc (m *NetworkManager) initDomains() error {\n\tactions := []Action{network.Enable()}\n\n\t// Only enable the Fetch domain if necessary, as it has a performance overhead.\n\tif m.userReqInterceptionEnabled {\n\t\tactions = append(actions,\n\t\t\tnetwork.SetCacheDisabled(true),\n\t\t\tfetch.Enable().WithPatterns([]*fetch.RequestPattern{{URLPattern: \"*\"}}))\n\t}\n\tfor _, action := range actions {\n\t\tif err := action.Do(cdp.WithExecutor(m.ctx, m.session)); err != nil {\n\t\t\treturn fmt.Errorf(\"initializing networking %T: %w\", action, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (m *NetworkManager) initEvents() {\n\tchHandler := make(chan Event)\n\tm.session.on(m.ctx, []string{\n\t\tcdproto.EventNetworkLoadingFailed,\n\t\tcdproto.EventNetworkLoadingFinished,\n\t\tcdproto.EventNetworkRequestWillBeSent,\n\t\tcdproto.EventNetworkRequestWillBeSentExtraInfo,\n\t\tcdproto.EventNetworkRequestServedFromCache,\n\t\tcdproto.EventNetworkResponseReceived,\n\t\tcdproto.EventNetworkResponseReceivedExtraInfo,\n\t\tcdproto.EventFetchRequestPaused,\n\t\tcdproto.EventFetchAuthRequired,","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/common/network_manager.go#L358-L394","documentation":"Failure while enabling the CDP Network domain (and, when request interception is active, disabling cache and enabling Fetch with the catch-all pattern) during NetworkManager initialization. Indicates the DevTools session rejected a domain-enable command — closed target, protocol error, or browser startup issue — not a script-level mistake.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/network_manager.go:376 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the browser launched successfully and the target is reachable","Retry browser/page creation — transient CDP failures can occur during startup","Check for browser crashes or resource exhaustion (too many concurrent browsers)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}