{"record":{"id":"b35a2f928837fd72","repo":"goharbor/harbor","slug":"failed-to-do-the-prepare-work-for-pushing-uploadin","errorCode":null,"errorMessage":"failed to do the prepare work for pushing/uploading resources: %v","messagePattern":"failed to do the prepare work for pushing/uploading resources: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/replication/flow/stage.go","lineNumber":119,"sourceCode":"\t\t}\n\t\tres.Metadata = &model.ResourceMetadata{\n\t\t\tRepository: &model.Repository{\n\t\t\t\tName:     name,\n\t\t\t\tMetadata: resource.Metadata.Repository.Metadata,\n\t\t\t},\n\t\t\tVtags:     resource.Metadata.Vtags,\n\t\t\tArtifacts: resource.Metadata.Artifacts,\n\t\t}\n\t\tresult = append(result, res)\n\t}\n\tlog.Debug(\"assemble the destination resources completed\")\n\treturn result, nil\n}\n\n// do the prepare work for pushing/uploading the resources: create the namespace or repository\nfunc prepareForPush(adapter adp.Adapter, resources []*model.Resource) error {\n\tif err := adapter.PrepareForPush(resources); err != nil {\n\t\treturn fmt.Errorf(\"failed to do the prepare work for pushing/uploading resources: %v\", err)\n\t}\n\tlog.Debug(\"the prepare work for pushing/uploading resources completed\")\n\treturn nil\n}\n\n// return the name with format \"res_name\" or \"res_name:[vtag1,vtag2,vtag3]\"\n// if the resource has vtags\nfunc getResourceName(res *model.Resource) string {\n\tif res == nil {\n\t\treturn \"\"\n\t}\n\tmeta := res.Metadata\n\tif meta == nil {\n\t\treturn \"\"\n\t}\n\tn := 0\n\tif len(meta.Artifacts) > 0 {\n\t\tfor _, artifact := range meta.Artifacts {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/replication/flow/stage.go#L101-L137","documentation":"Error \"failed to do the prepare work for pushing/uploading resources: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/replication/flow/stage.go:119 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"}