{"record":{"id":"665151e770a76908","repo":"grafana/k6","slug":"ip-s-is-in-a-blacklisted-range-q","errorCode":null,"errorMessage":"IP %s is in a blacklisted range %q","messagePattern":"IP (.+?) is in a blacklisted range %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/network_manager.go","lineNumber":739,"sourceCode":"\tfailErr = checkBlockedIPs(ip, state.Options.BlacklistIPs)\n}\n\nfunc checkBlockedHosts(host string, blockedHosts *k6types.HostnameTrie) error {\n\tif blockedHosts == nil {\n\t\treturn nil\n\t}\n\tif match, blocked := blockedHosts.Contains(host); blocked {\n\t\treturn fmt.Errorf(\"hostname %s matches a blocked pattern %q\", host, match)\n\t}\n\treturn nil\n}\n\nfunc checkBlockedIPs(ip net.IP, blockedIPs []*k6lib.IPNet) error {\n\tfor _, ipnet := range blockedIPs {\n\t\tif ipnet.Contains(ip) {\n\t\t\t// TODO: Return netext.BlackListedIPError here once its private\n\t\t\t// fields are exported, or there's a constructor for it.\n\t\t\treturn fmt.Errorf(\"IP %s is in a blacklisted range %q\", ip, ipnet)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *NetworkManager) onAuthRequired(event *fetch.EventAuthRequired) {\n\tvar (\n\t\tres = fetch.AuthChallengeResponseResponseDefault\n\t\trid = event.RequestID\n\n\t\tusername, password string\n\t)\n\n\tswitch {\n\tcase m.attemptedAuth[rid]:\n\t\tdelete(m.attemptedAuth, rid)\n\t\tres = fetch.AuthChallengeResponseResponseCancelAuth\n\tcase !m.credentials.IsEmpty():","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/common/network_manager.go#L721-L757","documentation":"Deterministic policy rejection: the resolved IP of the request falls inside a CIDR range listed in the k6 blacklistIPs option, so the request is aborted. The offending inputs are the DNS resolution result and the user's blacklistIPs configuration.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/network_manager.go:739 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or shrink the matching blacklistIPs CIDR if the destination must be reached","Pin a different DNS resolution or host mapping to avoid the blocked IP","Treat as expected when blacklisting is intentional; assert the abort"],"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"}