{"record":{"id":"858aa4caaaa8641a","repo":"lionsoul2014/ip2region","slug":"failed-to-create-v6-config-w","errorCode":null,"errorMessage":"failed to create v6 config: %w","messagePattern":"failed to create v6 config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"binding/golang/service/ip2region.go","lineNumber":114,"sourceCode":"\t// create v4 config with default config items\n\tvar v4Config *Config\n\tif v4XdbPath == \"\" {\n\t\tv4Config = nil\n\t} else {\n\t\tv4Config, err = NewV4Config(VIndexCache, v4XdbPath, 20)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create v4 config: %w\", err)\n\t\t}\n\t}\n\n\t// create v6 config with default config items\n\tvar v6Config *Config\n\tif v6XdbPath == \"\" {\n\t\tv6Config = nil\n\t} else {\n\t\tv6Config, err = NewV6Config(VIndexCache, v6XdbPath, 20)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create v6 config: %w\", err)\n\t\t}\n\t}\n\n\treturn NewIp2Region(v4Config, v6Config)\n}\n\nfunc (ip2r *Ip2Region) Search(ip any) (string, error) {\n\tvar err error\n\tvar ipBytes []byte\n\tswitch v := ip.(type) {\n\tcase string:\n\t\tipBytes, err = xdb.ParseIP(v)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"parse ip %s: %w\", v, err)\n\t\t}\n\tcase []byte:\n\t\tipBytes = v\n\tdefault:","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/lionsoul2014/ip2region/blob/c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1/binding/golang/service/ip2region.go#L96-L132","documentation":"Go convenience constructor: building the default v6 config (open, verify, header/version check, vector-index load) failed; the wrapped error identifies the actual failing step.","triggerScenarios":"Thrown at binding/golang/service/ip2region.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause for the failing step","Ensure the v6 xdb path refers to a valid IPv6 database","Regenerate or re-download the database and retry"],"exampleFix":null,"handlingStrategy":"try-catch","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"}