Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "expiration manager is nil on tokenstore" error log for dr secondary #22137

Merged
merged 4 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/22137.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core: Remove "expiration manager is nil on tokenstore" error log for unauth requests on DR secondary as they do not have expiration manager.
```
8 changes: 7 additions & 1 deletion vault/token_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,14 @@ func (ts *TokenStore) lookupInternal(ctx context.Context, id string, salted, tai
// If we are still restoring the expiration manager, we want to ensure the
// token is not expired
if ts.expiration == nil {
return nil, errors.New("expiration manager is nil on tokenstore")
switch ts.core.IsDRSecondary() {
case true: // Bail if on DR secondary as expiration manager is nil
return nil, nil
default:
return nil, errors.New("expiration manager is nil on tokenstore")
}
}

le, err := ts.expiration.FetchLeaseTimesByToken(ctx, entry)
if err != nil {
return nil, fmt.Errorf("failed to fetch lease times: %w", err)
Expand Down