{"record":{"id":"ef1b24aaab10e6ce","repo":"benbjohnson/litestream","slug":"read-existing-lease-w","errorCode":null,"errorMessage":"read existing lease: %w","messagePattern":"read existing lease: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"s3/leaser.go","lineNumber":93,"sourceCode":"func (l *Leaser) SetClient(client S3API) {\n\tl.s3 = client\n}\n\nfunc (l *Leaser) Type() string {\n\treturn LeaserType\n}\n\nfunc (l *Leaser) lockKey() string {\n\tif l.Path == \"\" {\n\t\treturn DefaultLeasePath\n\t}\n\treturn l.Path + \"/\" + DefaultLeasePath\n}\n\nfunc (l *Leaser) AcquireLease(ctx context.Context) (*litestream.Lease, error) {\n\texisting, etag, err := l.readLease(ctx)\n\tif err != nil && !errors.Is(err, os.ErrNotExist) {\n\t\treturn nil, fmt.Errorf(\"read existing lease: %w\", err)\n\t}\n\n\tif existing != nil && !existing.IsExpired() {\n\t\treturn nil, &litestream.LeaseExistsError{\n\t\t\tOwner:     existing.Owner,\n\t\t\tExpiresAt: existing.ExpiresAt,\n\t\t}\n\t}\n\n\tvar generation int64 = 1\n\tif existing != nil {\n\t\tgeneration = existing.Generation + 1\n\t}\n\n\tnewLease := &litestream.Lease{\n\t\tGeneration: generation,\n\t\tExpiresAt:  time.Now().Add(l.TTL),\n\t\tOwner:      l.Owner,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/s3/leaser.go#L75-L111","documentation":"Leaser.AcquireLease's initial readLease failed with an error other than not-exist. S3 GetObject on the lease key errored — credentials, bucket access, or connectivity — so the current lease state could not be inspected before acquiring.","triggerScenarios":"Thrown at s3/leaser.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify S3 credentials can GetObject on the lease key","Check bucket name and connectivity","Retry lease acquisition once the backend is healthy"],"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"}