goharbor/harbor · error

the resource cannot be null

Error message

the resource cannot be null

What it means

Error "the resource cannot be null" thrown in goharbor/harbor.

Source

Thrown at src/pkg/reg/adapter/dtr/adapter.go:156

			return nil
		})
	}

	if err = runner.Wait(); err != nil {
		return nil, err
	}

	return resources, nil
}

// PrepareForPush creates docker repository in DTR
func (a *adapter) PrepareForPush(resources []*model.Resource) error {
	var dtrNamespaces []Account
	var repos []string
	namespaces := make(map[string]string)
	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 namespace of resource cannot be null")
		}
		if len(resource.Metadata.Repository.Name) == 0 {
			return errors.New("the name of namespace cannot be null")
		}
		path := strings.Split(resource.Metadata.Repository.Name, "/")
		if len(path) > 0 {
			namespaces[path[0]] = path[0]
		}
		if len(resource.Metadata.Repository.Name) > 0 {
			repos = append(repos, resource.Metadata.Repository.Name)
		}
	}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/pkg/reg/adapter/dtr/adapter.go:156 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/3d023506f1ba53e2. Report an issue: GitHub.