{"record":{"id":"806760bfc792858e","repo":"goharbor/harbor","slug":"failed-to-get-adapter-factory-for-registry-type-s","errorCode":null,"errorMessage":"failed to get adapter factory for registry type %s: %v","messagePattern":"failed to get adapter factory for registry type (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/replication/flow/stage.go","lineNumber":37,"sourceCode":"\t\"path\"\n\t\"strings\"\n\n\trepctlmodel \"github.com/goharbor/harbor/src/controller/replication/model\"\n\t\"github.com/goharbor/harbor/src/lib/errors\"\n\t\"github.com/goharbor/harbor/src/lib/log\"\n\tadp \"github.com/goharbor/harbor/src/pkg/reg/adapter\"\n\t\"github.com/goharbor/harbor/src/pkg/reg/model\"\n)\n\n// get/create the source registry, destination registry, source adapter and destination adapter\nfunc initialize(policy *repctlmodel.Policy) (adp.Adapter, adp.Adapter, error) {\n\tvar srcAdapter, dstAdapter adp.Adapter\n\tvar err error\n\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}","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/replication/flow/stage.go#L19-L55","documentation":"Error \"failed to get adapter factory for registry type %s: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/replication/flow/stage.go:37 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"}