{"record":{"id":"4f6880932cbb52c0","repo":"grafana/k6","slug":"unknown-error-code-s","errorCode":null,"errorMessage":"unknown error code: %s","messagePattern":"unknown error code: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/network_manager.go","lineNumber":914,"sourceCode":"// 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}\n\nfunc (m *NetworkManager) AbortRequest(requestID fetch.RequestID, errorReason string) error {\n\tm.logger.Debugf(\"NetworkManager:AbortRequest\", \"aborting request (id: %s, errorReason: %s)\",\n\t\trequestID, errorReason)\n\tnetErrorReason, ok := m.errorReasons[errorReason]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown error code: %s\", errorReason)\n\t}\n\n\taction := fetch.FailRequest(requestID, netErrorReason)\n\tif err := action.Do(cdp.WithExecutor(m.ctx, m.session)); err != nil {\n\t\t// Avoid logging as error when context is canceled.\n\t\t// Most probably this happens when trying to fail a site's background request\n\t\t// while the iteration is ending and therefore the browser context is being closed.\n\t\tif errors.Is(err, context.Canceled) {\n\t\t\tm.logger.Debug(\"NetworkManager:AbortRequest\", \"context canceled interrupting request\")\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"fail to abort request (id: %s): %w\", requestID, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (m *NetworkManager) ContinueRequest(","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/common/network_manager.go#L896-L932","documentation":"Validation guard in AbortRequest: the errorReason string supplied to route.abort() is not one of the recognized CDP error reasons (e.g. failed, aborted, timedout, name_not_resolved and the other mapped lowercase keys). The offending input is the reason argument passed from the script.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/network_manager.go:914 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported reason such as 'failed', 'aborted', 'timedout', 'connectionrefused'","Omit the argument to use the default reason if unsure","Check the exact spelling — the lookup is on the lowercased reason table"],"exampleFix":null,"handlingStrategy":"validation","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"}