getsentry / getsentry/self-hosted

Send Test Notification results in "An unexpected error occurred. Error ID: 'None'" & cannot create any new alert

Open
#4,424 12 comments 0 reactions 0 assignees View on GitHub
Notifications Waiting for: Product Owner
Dominant language
Shell
Stars
9.6k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
15

Description

### Self-Hosted Version

26.7.0

### CPU Architecture

aarch64

### Docker Version

29.6.2

### Docker Compose Version

5.3.1

### Machine Specification

- [x] My system meets the minimum system requirements of Sentry

### Installation Type

Upgrade from 26.1 to 26.5, 26.6 then 26.7

### Steps to Reproduce

1. Go to Monitor -> Alerts
2. Create alert
3. For THEN select Notify on preferred channel, then choose Notify member and select a member
4. Click Send Test Notification

### Expected Result

Test notification should be sent to user

### Actual Result

An unexpected error occurred. Error ID: 'None'

docker compose logs shows this:

```
web-1 | Traceback (most recent call last):
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/processors/detector.py", line 107, in get_detectors_for_event_data
web-1 | issue_stream_detector = Detector.get_issue_stream_detector_for_project(
web-1 | event_data.group.project_id
web-1 | )
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/models/detector.py", line 139, in get_issue_stream_detector_for_project
web-1 | return cls.get_default_detector_for_project(project_id, IssueStreamGroupType.slug)
web-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/models/detector.py", line 125, in get_default_detector_for_project
web-1 | detector = cls.objects.get(project_id=project_id, type=detector_type)
web-1 | File "/.venv/lib/python3.13/site-packages/django/db/models/manager.py", line 87, in manager_method
web-1 | return getattr(self.get_queryset(), name)(*args, **kwargs)
web-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
web-1 | File "/.venv/lib/python3.13/site-packages/django/db/models/query.py", line 635, in get
web-1 | raise self.model.DoesNotExist(
web-1 | "%s matching query does not exist." % self.model._meta.object_name
web-1 | )
web-1 | sentry.workflow_engine.models.detector.Detector.DoesNotExist: Detector matching query does not exist.
web-1 | 19:15:00 [ERROR] sentry.workflow_engine.processors.detector: Issue stream detector not found for event (project_id=1 group_id=306)
web-1 | Traceback (most recent call last):
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/processors/detector.py", line 176, in get_preferred_detector
web-1 | raise Detector.DoesNotExist("No detectors found for event")
web-1 | sentry.workflow_engine.models.detector.Detector.DoesNotExist: No detectors found for event
web-1 | 19:15:01 [ERROR] sentry.workflow_engine.processors.detector: Detector not found for event data (type= id='bca89751683d4b3bb3d67a9173c68eac' group_id=306)
web-1 | Traceback (most recent call last):
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/endpoints/utils/test_fire_action.py", line 21, in test_fire_action
web-1 | action.trigger(
web-1 | ~~~~~~~~~~~~~~^
web-1 | event_data=event_data,
web-1 | ^^^^^^^^^^^^^^^^^^^^^^
web-1 | notification_uuid=str(uuid.uuid4()),
web-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1 | workflow_id=workflow_id,
web-1 | ^^^^^^^^^^^^^^^^^^^^^^^^
web-1 | )
web-1 | ^
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/models/action.py", line 136, in trigger
web-1 | detector = get_preferred_detector(event_data)
web-1 | File "/usr/src/sentry/src/sentry/workflow_engine/processors/detector.py", line 176, in get_preferred_detector
web-1 | raise Detector.DoesNotExist("No detectors found for event")
web-1 | sentry.workflow_engine.models.detector.Detector.DoesNotExist: No detectors found for event
web-1 | 19:15:01 [WARNING] sentry.workflow_engine.endpoints.utils.test_fire_action: email.test_alert.unexpected_exception
web-1 | 19:15:01 [INFO] sentry_sdk.errors: DedupeIntegration dropped duplicated error event No detectors found for event
web-1 | 19:15:01 [INFO] sentry_sdk.errors: event processor (.processor at 0xf07871bb0e00>) dropped event
```

I got to this place because during the update process from 26.1 to 26.7, notifications got moved and our notifications should've been migrated, but they weren't.

### Event ID

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with src/sentry/workflow_engine/processors/detector.py, especially get_detectors_for_event_data and get_preferred_detector, then review the Detector lookups in src/sentry/workflow_engine/models/detector.py. Reproduce the alert test-notification flow and inspect the logged missing-detector path. Done means sending a test notification and creating the alert no longer produce the unexpected error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, python
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.