{"record":{"id":"ccc7c679d62f1349","repo":"grafana/k6","slug":"internal-error-while-updating-protocol-request-int","errorCode":null,"errorMessage":"internal error while updating protocol request interception %T: %w","messagePattern":"internal error while updating protocol request interception %T: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/network_manager.go","lineNumber":889,"sourceCode":"\t\tnetwork.SetCacheDisabled(true),\n\t\tfetch.Enable().\n\t\t\tWithHandleAuthRequests(true).\n\t\t\tWithPatterns([]*fetch.RequestPattern{\n\t\t\t\t{\n\t\t\t\t\tURLPattern:   \"*\",\n\t\t\t\t\tRequestStage: fetch.RequestStageRequest,\n\t\t\t\t},\n\t\t\t}),\n\t}\n\tif !enabled {\n\t\tactions = []Action{\n\t\t\tnetwork.SetCacheDisabled(false),\n\t\t\tfetch.Disable(),\n\t\t}\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(\"internal error while updating protocol request interception %T: %w\", action, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Authenticate sets HTTP authentication credentials to use.\nfunc (m *NetworkManager) Authenticate(credentials Credentials) error {\n\tm.credentials = credentials\n\tif !credentials.IsEmpty() {\n\t\tm.userReqInterceptionEnabled = true\n\t}\n\tif err := m.updateProtocolRequestInterception(); err != nil {\n\t\treturn fmt.Errorf(\"setting authentication credentials: %w\", err)\n\t}\n\n\treturn nil\n}","sourceCodeStart":871,"sourceCodeEnd":907,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/common/network_manager.go#L871-L907","documentation":"Failure while flipping the CDP Fetch/Network configuration that implements request interception (enabling Fetch with auth handling and cache disable, or disabling both). Marked 'internal' because the failing action is protocol bookkeeping the user does not directly control; usually the session died or the browser rejected the domain change.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/network_manager.go:889 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the browser session is healthy before enabling interception/authentication","Retry the operation (Route, Authenticate) after re-establishing the page","Report as a k6/browser bug if it reproduces on a live, idle browser"],"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"}