{"record":{"id":"ca6963c79181ddd6","repo":"goharbor/harbor","slug":"unsupported-type-s","errorCode":null,"errorMessage":"unsupported type '%s'","messagePattern":"unsupported type '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/p2p/preheat/provider/preheat_image.go","lineNumber":83,"sourceCode":"\t}\n\n\treturn nil\n}\n\n// ToJSON encodes the preheating image to JSON data.\nfunc (img *PreheatImage) ToJSON() (string, error) {\n\tdata, err := json.Marshal(img)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"encode preheating image error: %w\", err)\n\t}\n\n\treturn string(data), nil\n}\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":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/p2p/preheat/provider/preheat_image.go#L65-L101","documentation":"Validation in PreheatImage.Validate: img.Type is not in the SupportedTypes list, so the preheat image kind is not recognized by P2P providers.","triggerScenarios":"Thrown at src/pkg/p2p/preheat/provider/preheat_image.go:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the preheat request type to a supported value such as 'image'","Check the API/UI payload that constructed the preheat request"],"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"}