{"record":{"id":"625dbcd667752429","repo":"goharbor/harbor","slug":"invalid-service-format-expected-registry-aliyunc","errorCode":null,"errorMessage":"invalid service format: expected 'registry.aliyuncs.com:region:xxxxx'","messagePattern":"invalid service format: expected 'registry\\.aliyuncs\\.com:region:xxxxx'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/aliacr/adapter.go","lineNumber":79,"sourceCode":"func getRegistryURL(url string) (string, error) {\n\tif url == \"\" {\n\t\treturn \"\", errors.New(\"empty url\")\n\t}\n\trs := regACRServiceURL.FindStringSubmatch(url)\n\tif rs == nil {\n\t\treturn url, nil\n\t}\n\treturn fmt.Sprintf(registryEndpointTpl, rs[1]), nil\n}\n\n// example:\n// registry.aliyuncs.com:cn-hangzhou:china:cri-xxxxxxxxx\n// registry.aliyuncs.com:cn-hangzhou:26842\nfunc parseRegistryService(service string) (*registryServiceInfo, error) {\n\tparts := strings.Split(service, \":\")\n\tlength := len(parts)\n\tif length < 2 {\n\t\treturn nil, errors.New(\"invalid service format: expected 'registry.aliyuncs.com:region:xxxxx'\")\n\t}\n\n\tif !strings.EqualFold(parts[0], registryACRService) {\n\t\treturn nil, errors.New(\"not a acr service\")\n\t}\n\n\tif strings.HasPrefix(parts[length-1], \"cri-\") {\n\t\treturn &registryServiceInfo{\n\t\t\tIsACREE:    true,\n\t\t\tRegionID:   parts[1],\n\t\t\tInstanceID: parts[length-1],\n\t\t}, nil\n\t}\n\treturn &registryServiceInfo{\n\t\tIsACREE:  false,\n\t\tRegionID: parts[1],\n\t}, nil\n}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/aliacr/adapter.go#L61-L97","documentation":"Error \"invalid service format: expected 'registry.aliyuncs.com:region:xxxxx'\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/aliacr/adapter.go:79 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"}