{"record":{"id":"c5bf9d2b3b273773","repo":"benbjohnson/litestream","slug":"bucket-required-for-abs-replica","errorCode":null,"errorMessage":"bucket required for abs replica","messagePattern":"bucket required for abs replica","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1795,"sourceCode":"\t\tu, err := url.Parse(c.URL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif client.AccountName == \"\" && u.User != nil {\n\t\t\tclient.AccountName = u.User.Username()\n\t\t}\n\t\tif client.Bucket == \"\" {\n\t\t\tclient.Bucket = u.Host\n\t\t}\n\t\tif client.Path == \"\" {\n\t\t\tclient.Path = strings.TrimPrefix(path.Clean(u.Path), \"/\")\n\t\t}\n\t}\n\n\t// Ensure required settings are set.\n\tif client.Bucket == \"\" {\n\t\treturn nil, fmt.Errorf(\"bucket required for abs replica\")\n\t}\n\n\treturn client, nil\n}\n\n// newSFTPReplicaClientFromConfig returns a new instance of sftp.ReplicaClient built from config.\nfunc newSFTPReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *sftp.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 sftp replica\")\n\t} else if c.URL != \"\" && c.Host != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & host for sftp replica\")\n\t}\n\n\thost, user, password, path := c.Host, c.User, c.Password, c.Path\n\n\t// Apply settings from URL, if specified.\n\tif c.URL != \"\" {","sourceCodeStart":1777,"sourceCodeEnd":1813,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1777-L1813","documentation":"Thrown by newABSReplicaClientFromConfig in cmd/litestream/main.go after config parsing: the Azure Blob Storage replica client requires a container (stored in client.Bucket). The bucket is normally taken from c.Bucket or derived from the URL host; if neither yields a non-empty value, startup of this replica fails because ABS cannot address any storage container.","triggerScenarios":"An 'abs' replica is configured where neither replica.bucket nor replica.url is set (or url has an empty host, e.g. 'azure://'), so client.Bucket remains empty after URL application.","commonSituations":"YAML typo like 'containers:' instead of 'bucket:', forgetting the replica url while migrating from per-field config, or an env-expanded url that expanded to an empty/invalid string.","solutions":["Set 'bucket: <container-name>' in the abs replica config block","Or set 'url: azure://<container>/<path>' so the bucket is derived from the URL host","Verify with 'litestream -config <file> test' style validation that the YAML key names are correct"],"exampleFix":"# before\nreplicas:\n  - type: abs\n    path: db/replica\n# after\nreplicas:\n  - type: abs\n    bucket: my-container\n    path: db/replica","handlingStrategy":"validation","validationCode":"// before loading config in Go\nif rep.Type == \"abs\" {\n    u, _ := url.Parse(rep.URL)\n    if rep.Bucket == \"\" && (rep.URL == \"\" || u.Host == \"\") {\n        return fmt.Errorf(\"abs replica %s: set bucket or a url with a host\", rep.Name)\n    }\n}","typeGuard":"func absBucketConfigured(c *ReplicaConfig) bool {\n    if c.Bucket != \"\" { return true }\n    if c.URL == \"\" { return false }\n    u, err := url.Parse(c.URL)\n    return err == nil && u.Host != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always set 'bucket:' for abs replicas even when using url","Validate config with a startup dry-run before deploying","Pin YAML key names (bucket, not container) in your config templates"],"tags":["config","azure","litestream","validation"],"backgroundTag":"missing-required-config-field","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"}