{"record":{"id":"ca5cd5978c07c27c","repo":"lionsoul2014/ip2region","slug":"invalid-ipv6-address-multi-double-colon-detected","errorCode":null,"errorMessage":"invalid ipv6 address: multi double colon detected","messagePattern":"invalid ipv6 address: multi double colon detected","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"binding/javascript/util.js","lineNumber":91,"sourceCode":"}\n\n// parse ipv6 address\nfunction _parse_ipv6_addr(v6String) {\n    let ps = v6String.split(':', 8);\n    if (ps.length < 3) {\n        throw new Error('invalid ipv6 address');\n    }\n\n    let dc_num = 0, offset = 0;\n    const ipBytes = Buffer.alloc(16);\n    for (var i = 0; i < ps.length; i++) {\n        let s = ps[i].trim();\n\n        // Double colon check and auto padding\n        if (s.length == 0) {\n            // ONLY one double colon allow\n            if (dc_num > 0) {\n                throw new Error('invalid ipv6 address: multi double colon detected');\n            }\n\n            let start = i, mi = ps.length - 1;\n            // clear all the consecutive spaces\n            for (i++;;) {\n                s = ps[i].trim();\n                if (s.length > 0) {\n                    i--;\n                    break;\n                }\n\n                if (i >= mi) {\n                    break;\n                }\n\n                i++;\n            }\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/lionsoul2014/ip2region/blob/c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1/binding/javascript/util.js#L73-L109","documentation":"IPv6 parser guard: RFC 4291 allows at most one '::' zero-run abbreviation per address; the input contained two or more empty groups (e.g. '1::2::3'), so the expansion of the elided zeros would be ambiguous.","triggerScenarios":"Thrown at binding/javascript/util.js:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the address with only one '::', or expand all groups explicitly (eight groups, no double colon)","Fix the likely typo that produced a second empty group","Pre-validate the address with net.isIPv6 before search"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1","analyzedAt":"2026-09-02T16:58:39.988Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}