{"record":{"id":"faa50329b916f563","repo":"benbjohnson/litestream","slug":"unknown-replica-type-in-config-q","errorCode":null,"errorMessage":"unknown replica type in config: %q","messagePattern":"unknown replica type in config: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1412,"sourceCode":"\t\t}\n\tcase \"sftp\":\n\t\tif r.Client, err = newSFTPReplicaClientFromConfig(c, r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase \"webdav\":\n\t\tif r.Client, err = newWebDAVReplicaClientFromConfig(c, r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase \"nats\":\n\t\tif r.Client, err = newNATSReplicaClientFromConfig(c, r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase \"oss\":\n\t\tif r.Client, err = newOSSReplicaClientFromConfig(c, r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown replica type in config: %q\", c.ReplicaType())\n\t}\n\n\tr.Client.SetLogger(r.Logger())\n\n\treturn r, nil\n}\n\n// newFileReplicaClientFromConfig returns a new instance of file.ReplicaClient built from config.\nfunc newFileReplicaClientFromConfig(c *ReplicaConfig, r *litestream.Replica) (_ *file.ReplicaClient, err error) {\n\t// Ensure URL & path are not both specified.\n\tif c.URL != \"\" && c.Path != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & path for file replica\")\n\t}\n\n\t// Parse configPath from URL, if specified.\n\tconfigPath := c.Path\n\tif c.URL != \"\" {\n\t\tif _, _, configPath, err = litestream.ParseReplicaURL(c.URL); err != nil {","sourceCodeStart":1394,"sourceCodeEnd":1430,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1394-L1430","documentation":"The replica's resolved type (from its URL scheme or `type` field via c.ReplicaType()) does not match any supported backend switch case in NewReplicaFromConfig, so Litestream cannot build a replica client.","triggerScenarios":"`url: redis://...` or an unknown scheme in the replica config, or a `type:` value that is not one of s3, gcs, abs, sftp, file, oss, etc.","commonSituations":"Typos like `s4://` or `S3://` with wrong casing depending on normalization; using a backend compiled out of the build (e.g. oss only in CN builds); pointing at a provider via a scheme Litestream doesn't know.","solutions":["Use a supported URL scheme: s3://, gcs://, abs://, sftp://, file://, oss://","Fix the `type:` field spelling to match a supported backend exactly","Confirm your Litestream build includes the backend (some replica clients are build-tag gated); rebuild if needed"],"exampleFix":"# before\nreplicas:\n  - url: redis://cache/db\n# after\nreplicas:\n  - url: s3://bucket/db","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"s3\":true,\"gcs\":true,\"abs\":true,\"sftp\":true,\"file\":true,\"oss\":true}\nif !allowed[strings.ToLower(cfg.ReplicaType())] {\n    return fmt.Errorf(\"replica type %q not supported\", cfg.ReplicaType())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only documented URL schemes for replicas","Check build flags if using optional backends like oss","Keep a supported-scheme list in config linting"],"tags":["config","replica","backend"],"backgroundTag":"invalid-enum-value","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}