{"record":{"id":"51b0e0a33f570a31","repo":"goharbor/harbor","slug":"invalid-region","errorCode":null,"errorMessage":"invalid region","messagePattern":"invalid region","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/volcenginecr/helper.go","lineNumber":47,"sourceCode":"\nfunc getRegionRegistryName(url string) (string, string, error) {\n\treg := regexp.MustCompile(`https://(.*)\\.cr\\.volces|ivolces\\.com`)\n\trs := reg.FindStringSubmatch(url)\n\tif rs == nil || len(rs) != 2 {\n\t\treturn \"\", \"\", errors.New(\"Invalid url\")\n\t}\n\tregistryNameRegion := rs[1]\n\tfor regionReg := range regionRegs {\n\t\treg = regexp.MustCompile(regionReg)\n\t\tres := reg.FindStringSubmatch(registryNameRegion)\n\t\tif res == nil || len(res) != 3 {\n\t\t\tlog.Debug(\"fail to match\", \"reg\", regionReg)\n\t\t\tcontinue\n\t\t}\n\t\treturn res[2], res[1], nil\n\t}\n\n\treturn \"\", \"\", errors.New(\"invalid region\")\n}\n\nvar resolveHost = func(host string) string { return host }\n\nfunc getRealmService(host string, insecure bool, caCert string) (string, string, error) {\n\tclient := &http.Client{\n\t\tTransport: util.GetHTTPTransport(insecure, caCert),\n\t\tTimeout:   config.RegistryHTTPClientTimeout(),\n\t}\n\n\t// Allow tests to override the host (e.g., inject mock server URL) via resolveHost\n\thost = resolveHost(host)\n\n\tresp, err := client.Get(host + \"/v2/\")\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tdefer resp.Body.Close() // nolint","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/volcenginecr/helper.go#L29-L65","documentation":"Error \"invalid region\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/volcenginecr/helper.go:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}