{"record":{"id":"b209bffac151da03","repo":"goharbor/harbor","slug":"malformed-registry-url-w","errorCode":null,"errorMessage":"malformed registry URL: %w","messagePattern":"malformed registry URL: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/p2p/preheat/provider/preheat_image.go","lineNumber":96,"sourceCode":"}\n\n// Validate PreheatImage\nfunc (img *PreheatImage) Validate() error {\n\tif !slices.Contains(SupportedTypes, img.Type) {\n\t\treturn fmt.Errorf(\"unsupported type '%s'\", img.Type)\n\t}\n\n\tif len(img.ImageName) == 0 || len(img.Tag) == 0 {\n\t\treturn errors.New(\"missing image repository or tag\")\n\t}\n\n\tif len(img.Headers) == 0 {\n\t\treturn errors.New(\"missing required headers\")\n\t}\n\n\t_, err := url.Parse(img.URL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"malformed registry URL: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":78,"sourceCodeEnd":101,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/p2p/preheat/provider/preheat_image.go#L78-L101","documentation":"Wrapped error in PreheatImage.Validate: url.Parse failed on the image's registry URL, so the preheat destination address is malformed; the underlying parse error is embedded.","triggerScenarios":"Thrown at src/pkg/p2p/preheat/provider/preheat_image.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a well-formed registry URL, e.g. 'https://registry.example.com'","Check the URL construction in the preheat policy/params","Handle the wrapped error for the underlying parse cause"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}