{"record":{"id":"60cbe99e786a08be","repo":"benbjohnson/litestream","slug":"s3-get-object-s-w","errorCode":null,"errorMessage":"s3: get object %s: %w","messagePattern":"s3: get object (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"s3/replica_client.go","lineNumber":709,"sourceCode":"\t\tBucket: aws.String(c.Bucket),\n\t\tKey:    aws.String(key),\n\t\tRange:  aws.String(rangeStr),\n\t}\n\n\t// Add SSE-C parameters if configured (required for reading SSE-C encrypted objects)\n\t// Note: SSE-KMS does not require parameters on read - decryption is automatic\n\tif c.SSECustomerKey != \"\" {\n\t\tinput.SSECustomerAlgorithm = aws.String(c.SSECustomerAlgorithm)\n\t\tinput.SSECustomerKey = aws.String(c.SSECustomerKey)\n\t\tinput.SSECustomerKeyMD5 = aws.String(c.SSECustomerKeyMD5)\n\t}\n\n\tout, err := c.s3.GetObject(ctx, input)\n\tif err != nil {\n\t\tif isNotExists(err) {\n\t\t\treturn nil, os.ErrNotExist\n\t\t}\n\t\treturn nil, fmt.Errorf(\"s3: get object %s: %w\", key, err)\n\t}\n\treturn out.Body, nil\n}\n\n// WriteLTXFile writes an LTX file to the replica.\n// Extracts timestamp from LTX header and stores it in S3 metadata to preserve original creation time.\n// Objects smaller than the part size are written with a single PutObject call\n// to avoid the multipart upload manager's 5 MiB part buffers (issue #1327).\nfunc (c *ReplicaClient) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error) {\n\tif err := c.Init(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilename := ltx.FormatFilename(minTXID, maxTXID)\n\tkey := c.Path + \"/\" + fmt.Sprintf(\"%04x/%s\", level, filename)\n\n\tpartSize := int64(manager.DefaultUploadPartSize)\n\tif c.PartSize > 0 {","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/s3/replica_client.go#L691-L727","documentation":"s3.OpenLTXFile's GetObject (with optional Range and SSE-C params) failed for a non-not-found reason. The LTX object could not be downloaded — network error, permission (including missing SSE-C parameters on an SSE-C-encrypted object), or throttling.","triggerScenarios":"Thrown at s3/replica_client.go:709 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped S3 error code (AccessDenied, InvalidRange, 400 for SSE-C mismatch)","If SSE-C is enabled, ensure the same key is configured for reads as for writes","Retry; syncs and restores re-attempt the download"],"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-14T00:17:10.932Z"}