{"record":{"id":"08faea7c3413ea42","repo":"benbjohnson/litestream","slug":"cannot-specify-url-path-for-gs-replica","errorCode":null,"errorMessage":"cannot specify url & path for gs replica","messagePattern":"cannot specify url & path for gs replica","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1722,"sourceCode":"\t\t\tclient.SSECustomerKey = strings.TrimSpace(string(keyData))\n\t\t} else {\n\t\t\tclient.SSECustomerKey = c.SSECustomerKey\n\t\t}\n\t}\n\n\t// Apply SSE-KMS configuration if specified.\n\tif c.SSEKMSKeyID != \"\" {\n\t\tclient.SSEKMSKeyID = c.SSEKMSKeyID\n\t}\n\n\treturn client, nil\n}\n\n// newGSReplicaClientFromConfig returns a new instance of gs.ReplicaClient built from config.\nfunc newGSReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *gs.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 gs replica\")\n\t} else if c.URL != \"\" && c.Bucket != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & bucket for gs replica\")\n\t}\n\n\tbucket, configPath := c.Bucket, c.Path\n\n\t// Apply settings from URL, if specified.\n\tif c.URL != \"\" {\n\t\t_, uhost, upath, err := litestream.ParseReplicaURL(c.URL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Only apply URL parts to field that have not been overridden.\n\t\tif configPath == \"\" {\n\t\t\tconfigPath = upath\n\t\t}\n\t\tif bucket == \"\" {","sourceCodeStart":1704,"sourceCodeEnd":1740,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1704-L1740","documentation":"Validation guard in newGSReplicaClientFromConfig that rejects a Google Cloud Storage replica config specifying both the full replica 'url' and its constituent 'path' field, since the URL already encodes the object prefix. Fires when ReplicaConfig.URL and ReplicaConfig.Path are both non-empty.","triggerScenarios":"Thrown at cmd/litestream/main.go:1722 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep only one: either the gs://bucket/path url or discrete 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-14T05:17:10.506Z"}