{"record":{"id":"05e6f26cea0eb21f","repo":"goharbor/harbor","slug":"failed-to-create-adapter-for-destination-registry","errorCode":null,"errorMessage":"failed to create adapter for destination registry %s: %v","messagePattern":"failed to create adapter for destination registry (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/replication/flow/stage.go","lineNumber":51,"sourceCode":"\n\t// create the source registry adapter\n\tsrcFactory, err := adp.GetFactory(policy.SrcRegistry.Type)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to get adapter factory for registry type %s: %v\", policy.SrcRegistry.Type, err)\n\t}\n\tsrcAdapter, err = srcFactory.Create(policy.SrcRegistry)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create adapter for source registry %s: %v\", policy.SrcRegistry.URL, err)\n\t}\n\n\t// create the destination registry adapter\n\tdstFactory, err := adp.GetFactory(policy.DestRegistry.Type)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to get adapter factory for registry type %s: %v\", policy.DestRegistry.Type, err)\n\t}\n\tdstAdapter, err = dstFactory.Create(policy.DestRegistry)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create adapter for destination registry %s: %v\", policy.DestRegistry.URL, err)\n\t}\n\tlog.Debug(\"replication flow initialization completed\")\n\treturn srcAdapter, dstAdapter, nil\n}\n\n// fetch resources from the source registry\nfunc fetchResources(adapter adp.Adapter, policy *repctlmodel.Policy) ([]*model.Resource, error) {\n\tvar resources []*model.Resource\n\treg, ok := adapter.(adp.ArtifactRegistry)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"the adapter doesn't implement the ArtifactRegistry interface\")\n\t}\n\tres, err := reg.FetchArtifacts(policy.Filters)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch artifacts: %v\", err)\n\t}\n\tresources = append(resources, res...)\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/replication/flow/stage.go#L33-L69","documentation":"Error \"failed to create adapter for destination registry %s: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/replication/flow/stage.go:51 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"}