benbjohnson/litestream · error

cannot specify url & bucket for abs replica

Error message

cannot specify url & bucket for abs replica

What it means

Validation guard in newABSReplicaClientFromConfig that rejects an Azure Blob Storage replica config specifying both the full replica 'url' and the 'bucket' (container) field, which would be contradictory. Fires when ReplicaConfig.URL and ReplicaConfig.Bucket are both set.

Source

Thrown at cmd/litestream/main.go:1763

	// Ensure required settings are set.
	if bucket == "" {
		return nil, fmt.Errorf("bucket required for gs replica")
	}

	// Build replica.
	client := gs.NewReplicaClient()
	client.Bucket = bucket
	client.Path = configPath
	return client, nil
}

// newABSReplicaClientFromConfig returns a new instance of abs.ReplicaClient built from config.
func newABSReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *abs.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 abs replica")
	} else if c.URL != "" && c.Bucket != "" {
		return nil, fmt.Errorf("cannot specify url & bucket for abs replica")
	}

	// Build replica.
	client := abs.NewReplicaClient()
	client.AccountName = c.AccountName
	client.AccountKey = c.AccountKey
	client.SASToken = c.SASToken
	client.Bucket = c.Bucket
	client.Path = c.Path
	client.Endpoint = c.Endpoint

	// Apply settings from URL, if specified.
	if c.URL != "" {
		u, err := url.Parse(c.URL)
		if err != nil {
			return nil, err
		}

View on GitHub (pinned to 4ed7a308f6)

Solutions

  1. Remove either url or bucket from the abs replica config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/litestream/main.go:1763 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/48ae03f496f92042. Report an issue: GitHub.