{"record":{"id":"38b6d7d18e508171","repo":"grafana/k6","slug":"s-network-cache-w","errorCode":null,"errorMessage":"%s network cache: %w","messagePattern":"(.+?) network cache: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/network_manager.go","lineNumber":855,"sourceCode":"\n\te, ok := m.reqIDToRequestPausedEvent[reqID]\n\n\treturn e, ok\n}\n\nfunc (m *NetworkManager) setRequestInterception(value bool) error {\n\tm.userReqInterceptionEnabled = value\n\treturn m.updateProtocolRequestInterception()\n}\n\nfunc (m *NetworkManager) updateProtocolCacheDisabled() error {\n\taction := network.SetCacheDisabled(m.userCacheDisabled)\n\tif err := action.Do(cdp.WithExecutor(m.ctx, m.session)); err != nil {\n\t\terrAction := \"enabling\"\n\t\tif m.userCacheDisabled {\n\t\t\terrAction = \"disabling\"\n\t\t}\n\t\treturn fmt.Errorf(\"%s network cache: %w\", errAction, err)\n\t}\n\treturn nil\n}\n\nfunc (m *NetworkManager) updateProtocolRequestInterception() error {\n\tenabled := m.userReqInterceptionEnabled\n\tif enabled == m.protocolReqInterceptionEnabled {\n\t\treturn nil\n\t}\n\n\tm.protocolReqInterceptionEnabled = enabled\n\tm.logger.Debugf(\"NetworkManager:updateProtocolRequestInterception\",\n\t\t\"updating request interception to %t (session: %s)\", enabled, m.session.ID())\n\n\tactions := []Action{\n\t\tnetwork.SetCacheDisabled(true),\n\t\tfetch.Enable().\n\t\t\tWithHandleAuthRequests(true).","sourceCodeStart":837,"sourceCodeEnd":873,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/common/network_manager.go#L837-L873","documentation":"Failure of the CDP Network.setCacheDisabled command when the cache state is being (de)activated in response to SetCacheEnabled. The verb in the message reflects the requested direction; the cause is a protocol-level failure (closed session/target or canceled context), not the boolean value itself.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/network_manager.go:855 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the page and session are alive when toggling cache","Call SetCacheEnabled before navigation begins rather than mid-teardown","Inspect the wrapped CDP error for connection-level causes"],"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"}