{"record":{"id":"4bf260bc687d2cf0","repo":"benbjohnson/litestream","slug":"delete-lease-w","errorCode":null,"errorMessage":"delete lease: %w","messagePattern":"delete lease: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"s3/leaser.go","lineNumber":192,"sourceCode":"\t}\n\tif lease.ETag == \"\" {\n\t\treturn ErrLeaseETagRequired\n\t}\n\n\tkey := l.lockKey()\n\t_, err := l.s3.DeleteObject(ctx, &s3.DeleteObjectInput{\n\t\tBucket:  aws.String(l.Bucket),\n\t\tKey:     aws.String(key),\n\t\tIfMatch: aws.String(lease.ETag),\n\t})\n\tif err != nil {\n\t\tif isNotExists(err) || isNotFoundError(err) {\n\t\t\treturn ErrLeaseAlreadyReleased\n\t\t}\n\t\tif isPreconditionFailed(err) {\n\t\t\treturn litestream.ErrLeaseNotHeld\n\t\t}\n\t\treturn fmt.Errorf(\"delete lease: %w\", err)\n\t}\n\n\tl.logger.Debug(\"lease released\",\n\t\t\"generation\", lease.Generation,\n\t\t\"owner\", lease.Owner)\n\n\treturn nil\n}\n\nfunc (l *Leaser) readLease(ctx context.Context) (*litestream.Lease, string, error) {\n\tkey := l.lockKey()\n\n\tout, err := l.s3.GetObject(ctx, &s3.GetObjectInput{\n\t\tBucket: aws.String(l.Bucket),\n\t\tKey:    aws.String(key),\n\t})\n\tif err != nil {\n\t\tif isNotExists(err) || isNotFoundError(err) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/s3/leaser.go#L174-L210","documentation":"Leaser.ReleaseLease's DeleteObject (with IfMatch on the lease ETag) failed with an unexpected error — not not-found (already released) and not precondition-failed (not held). Connectivity, credentials, or bucket access problem during release.","triggerScenarios":"Thrown at s3/leaser.go:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check S3 delete permissions on the lease key","Retry release after the backend error clears; the lease will expire on its TTL otherwise"],"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"}