benbjohnson/litestream · error
cannot specify url & bucket for gs replica
Error message
cannot specify url & bucket for gs replica
What it means
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.
Source
Thrown at cmd/litestream/main.go:1724
client.SSECustomerKey = c.SSECustomerKey
}
}
// Apply SSE-KMS configuration if specified.
if c.SSEKMSKeyID != "" {
client.SSEKMSKeyID = c.SSEKMSKeyID
}
return client, nil
}
// newGSReplicaClientFromConfig returns a new instance of gs.ReplicaClient built from config.
func newGSReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *gs.ReplicaClient, err error) {
// Ensure URL & constituent parts are not both specified.
if c.URL != "" && c.Path != "" {
return nil, fmt.Errorf("cannot specify url & path for gs replica")
} else if c.URL != "" && c.Bucket != "" {
return nil, fmt.Errorf("cannot specify url & bucket for gs replica")
}
bucket, configPath := c.Bucket, c.Path
// Apply settings from URL, if specified.
if c.URL != "" {
_, uhost, upath, err := litestream.ParseReplicaURL(c.URL)
if err != nil {
return nil, err
}
// Only apply URL parts to field that have not been overridden.
if configPath == "" {
configPath = upath
}
if bucket == "" {
bucket = uhost
}View on GitHub (pinned to 4ed7a308f6)
Solutions
- Remove either url or bucket from the replica config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cmd/litestream/main.go:1724 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of benbjohnson/litestream@4ed7a308f6 (2026-09-06).
Data as JSON: /api/errors/46133620ba384599.
Report an issue: GitHub.