Skip to content

Commit

Permalink
Add a check for missing entity during local alias invalidation. (#14622)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored Mar 21, 2022
1 parent 846db6a commit 6b6a97f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/14622.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
replication (enterprise): fix panic due to missing entity during invalidation of local aliases.
```
4 changes: 4 additions & 0 deletions vault/identity_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,10 @@ func (i *IdentityStore) Invalidate(ctx context.Context, key string) {
i.logger.Error("failed to fetch entity during local alias invalidation", "entity_id", alias.CanonicalID, "error", err)
return
}
if entity == nil {
i.logger.Error("failed to fetch entity during local alias invalidation, missing entity", "entity_id", alias.CanonicalID, "error", err)
continue
}

// Delete local aliases from the entity.
err = i.deleteAliasesInEntityInTxn(txn, entity, []*identity.Alias{alias})
Expand Down

0 comments on commit 6b6a97f

Please sign in to comment.