{"record":{"id":"b428e8eecd5ebb17","repo":"goharbor/harbor","slug":"the-metadata-of-resource-cannot-be-null-b428e8","errorCode":null,"errorMessage":"the metadata of resource cannot be null","messagePattern":"the metadata of resource cannot be null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/harbor/base/adapter.go","lineNumber":148,"sourceCode":"\tinfo.SupportedResourceFilters = append(info.SupportedResourceFilters,\n\t\t&model.FilterStyle{\n\t\t\tType:   model.FilterTypeLabel,\n\t\t\tStyle:  model.FilterStyleTypeList,\n\t\t\tValues: labels,\n\t\t})\n\n\treturn info, nil\n}\n\n// PrepareForPush creates projects\nfunc (a *Adapter) PrepareForPush(resources []*model.Resource) error {\n\tprojects := map[string]*Project{}\n\tfor _, resource := range resources {\n\t\tif resource == nil {\n\t\t\treturn errors.New(\"the resource cannot be null\")\n\t\t}\n\t\tif resource.Metadata == nil {\n\t\t\treturn errors.New(\"the metadata of resource cannot be null\")\n\t\t}\n\t\tif resource.Metadata.Repository == nil {\n\t\t\treturn errors.New(\"the repository of resource cannot be null\")\n\t\t}\n\t\tif len(resource.Metadata.Repository.Name) == 0 {\n\t\t\treturn errors.New(\"the name of the repository cannot be null\")\n\t\t}\n\n\t\tpaths := strings.Split(resource.Metadata.Repository.Name, \"/\")\n\t\tprojectName := paths[0]\n\t\t// handle the public properties\n\t\tmetadata := abstractPublicMetadata(resource.Metadata.Repository.Metadata)\n\t\tpro, exist := projects[projectName]\n\t\tif exist {\n\t\t\tmetadata = mergeMetadata(pro.Metadata, metadata)\n\t\t}\n\t\tprojects[projectName] = &Project{\n\t\t\tName:     projectName,","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/harbor/base/adapter.go#L130-L166","documentation":"Error \"the metadata of resource cannot be null\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/harbor/base/adapter.go:148 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"}