{"record":{"id":"1a7f6f1f309ce08b","repo":"benbjohnson/litestream","slug":"abs-account-name-is-required-when-endpoint-is-not","errorCode":null,"errorMessage":"abs: account name is required when endpoint is not specified","messagePattern":"abs: account name is required when endpoint is not specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"abs/replica_client.go","lineNumber":117,"sourceCode":"// 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}\n\n\t// Validate required configuration\n\tif c.Bucket == \"\" {\n\t\treturn fmt.Errorf(\"abs: container name is required\")\n\t}\n\n\t// Construct & parse endpoint unless already set.\n\tendpoint := c.Endpoint\n\tif endpoint == \"\" {\n\t\tif c.AccountName == \"\" {\n\t\t\treturn fmt.Errorf(\"abs: account name is required when endpoint is not specified\")\n\t\t}\n\t\tendpoint = fmt.Sprintf(\"https://%s.blob.core.windows.net\", c.AccountName)\n\t}\n\n\t// Configure client options with retry policy\n\tclientOptions := &azblob.ClientOptions{\n\t\tClientOptions: azcore.ClientOptions{\n\t\t\tRetry: policy.RetryOptions{\n\t\t\t\tMaxRetries:    10,\n\t\t\t\tRetryDelay:    time.Second,\n\t\t\t\tMaxRetryDelay: 30 * time.Second,\n\t\t\t\tTryTimeout:    15 * time.Minute, // Reasonable timeout for blob operations\n\t\t\t\tStatusCodes: []int{\n\t\t\t\t\thttp.StatusRequestTimeout,\n\t\t\t\t\thttp.StatusTooManyRequests,\n\t\t\t\t\thttp.StatusInternalServerError,\n\t\t\t\t\thttp.StatusBadGateway,\n\t\t\t\t\thttp.StatusServiceUnavailable,","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/abs/replica_client.go#L99-L135","documentation":"When no explicit Endpoint is configured, Init derives the Azure Blob endpoint from the AccountName (https://<account>.blob.core.windows.net). If neither Endpoint nor AccountName is set, it cannot build an endpoint and returns this error.","triggerScenarios":"Calling Init with c.Endpoint == \"\" and c.AccountName == \"\" — typically a config block that provides only a container name and credentials, or omits account details entirely.","commonSituations":"Using a custom endpoint but misspelling the key so it is never read; assuming account name can be inferred from credentials (it cannot); Azure Government/China users who must set endpoint explicitly and forgot the account-name too.","solutions":["Set account-name: <storage-account> in the abs replica config (or c.AccountName) so the default endpoint can be derived","Alternatively set endpoint: https://<account>.blob.core.windows.net (or a custom endpoint) explicitly","Verify with a minimal config that Init no longer reports the error before adding back optional fields"],"exampleFix":"// before\nreplica:\n  type: abs\n  bucket: mycontainer\n// after\nreplica:\n  type: abs\n  bucket: mycontainer\n  account-name: myaccount","handlingStrategy":"validation","validationCode":"if c.Endpoint == \"\" && c.AccountName == \"\" {\n    return errors.New(\"abs replica requires endpoint or account-name\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set account-name whenever endpoint is omitted","For Azure Government/China, set endpoint explicitly and still set account-name","Validate the config block before runtime Init"],"tags":["abs","azure","configuration","endpoint"],"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-14T00:17:10.932Z"}