goharbor/harbor · error
the metadata of resource cannot be null
Error message
the metadata of resource cannot be null
What it means
Error "the metadata of resource cannot be null" thrown in goharbor/harbor.
Source
Thrown at src/pkg/reg/adapter/harbor/base/adapter.go:148
info.SupportedResourceFilters = append(info.SupportedResourceFilters,
&model.FilterStyle{
Type: model.FilterTypeLabel,
Style: model.FilterStyleTypeList,
Values: labels,
})
return info, nil
}
// PrepareForPush creates projects
func (a *Adapter) PrepareForPush(resources []*model.Resource) error {
projects := map[string]*Project{}
for _, resource := range resources {
if resource == nil {
return errors.New("the resource cannot be null")
}
if resource.Metadata == nil {
return errors.New("the metadata of resource cannot be null")
}
if resource.Metadata.Repository == nil {
return errors.New("the repository of resource cannot be null")
}
if len(resource.Metadata.Repository.Name) == 0 {
return errors.New("the name of the repository cannot be null")
}
paths := strings.Split(resource.Metadata.Repository.Name, "/")
projectName := paths[0]
// handle the public properties
metadata := abstractPublicMetadata(resource.Metadata.Repository.Metadata)
pro, exist := projects[projectName]
if exist {
metadata = mergeMetadata(pro.Metadata, metadata)
}
projects[projectName] = &Project{
Name: projectName,View on GitHub (pinned to 7b2fd08cc5)
When it happens
Trigger: Thrown at src/pkg/reg/adapter/harbor/base/adapter.go:148 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/b428e8eecd5ebb17.
Report an issue: GitHub.