{"record":{"id":"63174cae788371bf","repo":"benbjohnson/litestream","slug":"bucket-required-for-abs-replica-url","errorCode":null,"errorMessage":"bucket required for abs replica URL","messagePattern":"bucket required for abs replica URL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"abs/replica_client.go","lineNumber":88,"sourceCode":"\tc.logger = logger.WithGroup(ReplicaClientType)\n}\n\n// NewReplicaClientFromURL creates a new ReplicaClient from URL components.\n// This is used by the replica client factory registration.\n// URL format: abs://[account-name@]container/path\nfunc NewReplicaClientFromURL(scheme, host, urlPath string, query url.Values, userinfo *url.Userinfo) (litestream.ReplicaClient, error) {\n\tclient := NewReplicaClient()\n\n\t// Extract account name from userinfo if present (abs://account@container/path)\n\tif userinfo != nil {\n\t\tclient.AccountName = userinfo.Username()\n\t}\n\n\tclient.Bucket = host\n\tclient.Path = urlPath\n\n\tif client.Bucket == \"\" {\n\t\treturn nil, fmt.Errorf(\"bucket required for abs replica URL\")\n\t}\n\n\treturn client, nil\n}\n\n// Type returns \"abs\" as the client type.\nfunc (c *ReplicaClient) Type() string {\n\treturn ReplicaClientType\n}\n\n// Init initializes the connection to Azure. No-op if already initialized.\nfunc (c *ReplicaClient) Init(ctx context.Context) (err error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tif c.client != nil {\n\t\treturn nil\n\t}","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/abs/replica_client.go#L70-L106","documentation":"NewReplicaClientFromURL parses an ABS (Azure Blob Storage) replica URL and requires a bucket (container) component in the URL host. When the URL has no container name, parsing cannot produce a usable client and this error is returned.","triggerScenarios":"Calling NewReplicaClientFromURL with an abs:// URL missing the host portion, e.g. 'abs:///some/path' or an empty/malformed URL where host (container) resolves to ''.","commonSituations":"Hand-edited config with an incomplete replica URL; copying a container-relative path instead of the full abs://container/path URL; YAML quoting stripping the host; automation templating leaving the container blank.","solutions":["Include the container name in the URL host: abs://mycontainer/path/to/replica","Re-check the replica URL in the config file for typos or a missing container segment","Print/validate the parsed URL (scheme, host, path) before passing it to NewReplicaClientFromURL"],"exampleFix":"// before\nclient, err := abs.NewReplicaClientFromURL(\"abs:///backups/db\")\n// after\nclient, err := abs.NewReplicaClientFromURL(\"abs://mycontainer/backups/db\")","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(replicaURL)\nif u.Scheme == \"abs\" && u.Host == \"\" {\n    return fmt.Errorf(\"abs URL %q missing container (bucket) host\", replicaURL)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use full URLs of form abs://container/path","Lint replica URLs in config before applying them","Template configs with validated container names, not empty defaults"],"tags":["abs","azure","url","configuration"],"backgroundTag":"missing-required-argument","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"}