{"record":{"id":"3d023506f1ba53e2","repo":"goharbor/harbor","slug":"the-resource-cannot-be-null","errorCode":null,"errorMessage":"the resource cannot be null","messagePattern":"the resource cannot be null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/dtr/adapter.go","lineNumber":156,"sourceCode":"\t\t\treturn nil\n\t\t})\n\t}\n\n\tif err = runner.Wait(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resources, nil\n}\n\n// PrepareForPush creates docker repository in DTR\nfunc (a *adapter) PrepareForPush(resources []*model.Resource) error {\n\tvar dtrNamespaces []Account\n\tvar repos []string\n\tnamespaces := make(map[string]string)\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 namespace 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 namespace cannot be null\")\n\t\t}\n\t\tpath := strings.Split(resource.Metadata.Repository.Name, \"/\")\n\t\tif len(path) > 0 {\n\t\t\tnamespaces[path[0]] = path[0]\n\t\t}\n\t\tif len(resource.Metadata.Repository.Name) > 0 {\n\t\t\trepos = append(repos, resource.Metadata.Repository.Name)\n\t\t}\n\t}","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/dtr/adapter.go#L138-L174","documentation":"Error \"the resource cannot be null\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/dtr/adapter.go:156 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"}