goharbor/harbor · error
failed to do the prepare work for pushing/uploading…
Error message
failed to do the prepare work for pushing/uploading resources: %v
What it means
prepareForPush wraps adapter.PrepareForPush failure: creating the destination namespace/project or repository before pushing replicated resources failed, e.g. due to permissions or name conflicts on the destination registry.
Solutions
- Verify the replication user has permission to create projects/namespaces on the destination
- Check for name conflicts or invalid destination project names
- Inspect the wrapped adapter error for the concrete cause
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/controller/replication/flow/stage.go:119 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/b35a2f928837fd72.
Report an issue: GitHub.
Appendix: source
Thrown at src/controller/replication/flow/stage.go:119
}
res.Metadata = &model.ResourceMetadata{
Repository: &model.Repository{
Name: name,
Metadata: resource.Metadata.Repository.Metadata,
},
Vtags: resource.Metadata.Vtags,
Artifacts: resource.Metadata.Artifacts,
}
result = append(result, res)
}
log.Debug("assemble the destination resources completed")
return result, nil
}
// do the prepare work for pushing/uploading the resources: create the namespace or repository
func prepareForPush(adapter adp.Adapter, resources []*model.Resource) error {
if err := adapter.PrepareForPush(resources); err != nil {
return fmt.Errorf("failed to do the prepare work for pushing/uploading resources: %v", err)
}
log.Debug("the prepare work for pushing/uploading resources completed")
return nil
}
// return the name with format "res_name" or "res_name:[vtag1,vtag2,vtag3]"
// if the resource has vtags
func getResourceName(res *model.Resource) string {
if res == nil {
return ""
}
meta := res.Metadata
if meta == nil {
return ""
}
n := 0
if len(meta.Artifacts) > 0 {
for _, artifact := range meta.Artifacts {View on GitHub (pinned to 7b2fd08cc5)