{"record":{"id":"c5a436c1fcf5bd47","repo":"benbjohnson/litestream","slug":"abs-cannot-upload-ltx-file-q-w","errorCode":null,"errorMessage":"abs: cannot upload ltx file %q: %w","messagePattern":"abs: cannot upload ltx file %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"abs/replica_client.go","lineNumber":250,"sourceCode":"\t}\n\ttimestamp := time.UnixMilli(hdr.Timestamp).UTC()\n\n\t// Combine buffered data with rest of reader\n\trc := internal.NewReadCounter(io.MultiReader(&buf, rd))\n\n\t// Upload blob with proper content type, access tier, and metadata\n\t// Azure metadata keys cannot contain hyphens, so use litestreamtimestamp\n\t_, err = c.client.UploadStream(ctx, c.Bucket, key, rc, &azblob.UploadStreamOptions{\n\t\tHTTPHeaders: &blob.HTTPHeaders{\n\t\t\tBlobContentType: to.Ptr(\"application/octet-stream\"),\n\t\t},\n\t\tAccessTier: to.Ptr(blob.AccessTierHot), // Use Hot tier as default\n\t\tMetadata: map[string]*string{\n\t\t\tMetadataKeyTimestamp: to.Ptr(timestamp.Format(time.RFC3339Nano)),\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"abs: cannot upload ltx file %q: %w\", key, err)\n\t}\n\n\tinternal.OperationTotalCounterVec.WithLabelValues(ReplicaClientType, \"PUT\").Inc()\n\tinternal.OperationBytesCounterVec.WithLabelValues(ReplicaClientType, \"PUT\").Add(float64(rc.N()))\n\n\treturn &ltx.FileInfo{\n\t\tLevel:     level,\n\t\tMinTXID:   minTXID,\n\t\tMaxTXID:   maxTXID,\n\t\tSize:      rc.N(),\n\t\tCreatedAt: timestamp,\n\t}, nil\n}\n\n// OpenLTXFile returns a reader for an LTX file.\n// Returns os.ErrNotExist if no matching min/max TXID is not found.\nfunc (c *ReplicaClient) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, offset, size int64) (io.ReadCloser, error) {\n\tif err := c.Init(ctx); err != nil {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/abs/replica_client.go#L232-L268","documentation":"The Azure blob UploadStream call failed while writing an LTX file to the container. This is a transient or permission I/O error against Azure Blob Storage: network failure, invalid bucket/container name, missing write authorization (RBAC or SAS), or wrong endpoint.","triggerScenarios":"Thrown at abs/replica_client.go:250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the container name exists and the credential has Storage Blob Data Contributor access","Check network connectivity and endpoint correctness","Retry the sync; Litestream will re-attempt the upload on the next cycle","Inspect the wrapped error for an azblob HttpResponse error code (AuthenticationFailed, ContainerNotFound, etc.)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}