{"record":{"id":"681ffe5dd7bc0a46","repo":"benbjohnson/litestream","slug":"cannot-specify-url-path-for-s3-replica","errorCode":null,"errorMessage":"cannot specify url & path for s3 replica","messagePattern":"cannot specify url & path for s3 replica","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1456,"sourceCode":"\t}\n\n\t// Expand home prefix and return absolute path.\n\tif configPath, err = expand(configPath); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Instantiate replica and apply time fields, if set.\n\tclient := file.NewReplicaClient(configPath)\n\tclient.Replica = r\n\treturn client, nil\n}\n\n// NewS3ReplicaClientFromConfig returns a new instance of s3.ReplicaClient built from config.\n// Exported for testing.\nfunc NewS3ReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *s3.ReplicaClient, err error) {\n\t// Ensure URL & constituent parts are not both specified.\n\tif c.URL != \"\" && c.Path != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & path for s3 replica\")\n\t} else if c.URL != \"\" && c.Bucket != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & bucket for s3 replica\")\n\t}\n\n\tbucket, configPath := c.Bucket, c.Path\n\tregion, endpoint, skipVerify := c.Region, c.Endpoint, c.SkipVerify\n\tstorageClass := c.StorageClass\n\tsignSetting := newBoolSetting(true)\n\tif v := c.SignPayload; v != nil {\n\t\tsignSetting.Set(*v)\n\t}\n\tsignAcceptEncodingSetting := newBoolSetting(true)\n\tif v := c.SignAcceptEncoding; v != nil {\n\t\tsignAcceptEncodingSetting.Set(*v)\n\t}\n\trequireSetting := newBoolSetting(true)\n\tif v := c.RequireContentMD5; v != nil {\n\t\trequireSetting.Set(*v)","sourceCodeStart":1438,"sourceCodeEnd":1474,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1438-L1474","documentation":"Validation guard in NewS3ReplicaClientFromConfig that rejects an S3 replica config specifying both the full replica 'url' and its constituent 'path' field, since combining them would leave the final object key ambiguous. Fires when ReplicaConfig.URL is non-empty and ReplicaConfig.Path is also set.","triggerScenarios":"Thrown at cmd/litestream/main.go:1456 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove either the url field or the path field from the replica config","Put the whole destination in one place: s3://bucket/path in url, or bucket+path fields"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}