{"record":{"id":"46133620ba384599","repo":"benbjohnson/litestream","slug":"cannot-specify-url-bucket-for-gs-replica","errorCode":null,"errorMessage":"cannot specify url & bucket for gs replica","messagePattern":"cannot specify url & bucket for gs replica","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1724,"sourceCode":"\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 == \"\" {\n\t\t\tbucket = uhost\n\t\t}","sourceCodeStart":1706,"sourceCodeEnd":1742,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1706-L1742","documentation":"Validation guard in newGSReplicaClientFromConfig that rejects a Google Cloud Storage replica config specifying both the full replica 'url' and the 'bucket' field, as the bucket is already the host portion of the URL. Fires when ReplicaConfig.URL and ReplicaConfig.Bucket are both set.","triggerScenarios":"Thrown at cmd/litestream/main.go:1724 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove either url or bucket from the replica config"],"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"}