Skip to content

Alert evaluation throws EntityNotFoundException when test case is deleted #29674

Closed

Description

@owlbotgit

Problem

When a test case is deleted, the deletion triggers a change event that is picked up by configured alerts. During alert evaluation, the system attempts to fetch the deleted entity from the database (e.g., via matchAnyDomain() in AlertsRuleEvaluator), which throws an EntityNotFoundException because the entity no longer exists.

Stack Trace

org.openmetadata.service.exception.EntityNotFoundException: testCase instance for <UUID> not found
  at org.openmetadata.service.jdbi3.EntityRepository.find(EntityRepository.java:1497)
  at org.openmetadata.service.jdbi3.EntityRepository.lambda$get$6(EntityRepository.java:1370)
  at org.openmetadata.service.Entity.getEntity(Entity.java:639)
  at org.openmetadata.service.events.subscription.AlertsRuleEvaluator.matchAnyDomain(AlertsRuleEvaluator.java:480)
  at org.openmetadata.service.events.subscription.AlertUtil.evaluateAlertConditions(AlertUtil.java:91)

Timeline

  • Delete request: DELETE /api/v1/dataQuality/testCases/<UUID> (200 OK)
  • ~6 seconds later: Alert evaluation job attempts to evaluate change event and fails

Root Cause

The change event processing makes a database call to fetch entity details during alert evaluation. For hard deletes, the entity is already removed from the database by the time the event is processed.

Expected Behavior

Change events for deletions should package all necessary entity information in the event payload itself, avoiding database lookups during alert evaluation. This approach should apply to hard deletes (soft deletes may still need DB access for entity state).

Impact

  • Server-side errors logged (does not appear to impact end users or alert delivery)
  • Potential alert processing delays or failures

Internal Reference

Slack thread: https://collate-inc.slack.com/archives/C0B25BQJC67/p1782912619688359

Activity

  1. moved this to Release Backlog 🚧 in Shippingon Jul 1, 2026
  2. added theissue type on Jul 15, 2026
  3. moved this from Release Backlog 🚧 to Done ✅ in Shippingon Aug 7, 2026
  4. added a commit that references this issue on Aug 7, 2026
    cb2a7e8
  5. added a commit that references this issue on Aug 12, 2026
    411e3b4
  6. added a commit that references this issue on Aug 12, 2026
    6bebdb7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions