fix(sentry): drop expected operator-input/transient noise (round 2)#3141
Merged
Conversation
Second Sentry sweep found four noise-class issues on 2026.7.0 — all expected conditions logged/captured as errors, each already handled gracefully for the operator: - recover endpoint: log a bad-archive upload at warning, not exception (already returns 400) — ANTHIAS-3W - viewer scheduler: log a since-deleted/processing jump target at warning and fall back to the playlist — ANTHIAS-3V - before_send: drop yt-dlp DownloadError (on_failure already records metadata.error_message for the operator) — ANTHIAS-3T - ignore the celery.backends.asynchronous reconnect-retry logger, same transient-redis noise as the others — ANTHIAS-3X Fixes #3140 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR reduces Sentry noise by downgrading expected operator-input/transient conditions from errors to warnings and by extending the Sentry before_send / ignore_logger filters so non-actionable events aren’t captured, while keeping user-facing outcomes intact.
Changes:
- Downgrade logging for invalid backup recovery uploads and for benign “jump to missing/still-processing asset” races.
- Drop yt-dlp
DownloadErrorin_sentry_before_send(matched by exception name+module) and ignorecelery.backends.asynchronouslogger noise. - Add regression tests covering each new suppression/downgrade.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_sentry.py | Adds tests for dropping yt-dlp DownloadError events and for ignoring celery.backends.asynchronous. |
| tests/test_scheduler.py | Adds regression test ensuring missing extra_asset logs warning (not error) and falls back. |
| src/anthias_viewer/scheduling.py | Changes missing/still-processing extra_asset logging from error to warning with asset context and fallback. |
| src/anthias_server/django_project/settings.py | Extends Sentry before_send drop list for yt-dlp DownloadError and ignores celery.backends.asynchronous. |
| src/anthias_server/api/views/mixins.py | Downgrades invalid backup recovery exception logging to warning while still returning 400 validation error. |
| src/anthias_server/api/tests/test_v1_endpoints.py | Adds regression test asserting invalid recover upload logs warning (not exception) and returns 400. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot review: startswith('yt_dlp') would also match yt_dlp2 /
yt_dlp_fake. Require the module to be exactly 'yt_dlp' or a
'yt_dlp.' submodule; added a look-alike-module negative test.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The API recover view was downgraded to warning for ANTHIAS-3W, but the HTML settings_recover view still logged the same operator-input failure via logger.exception. Bring it in line. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot review: the settings_recover exception→warning downgrade had no regression test (unlike the API path). Assert a bad archive logs at warning, not exception. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot review round 4: - add create=True to the API recover test's builtin-open patch (mixins.py has no module-level open), matching the sibling tests - the HTML recover test now actually asserts the error message is shown, matching its docstring Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…und2 # Conflicts: # src/anthias_server/api/tests/test_v1_endpoints.py
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issues Fixed
Description
A second Sentry sweep surfaced four new noise-class issues on
2026.7.0— all expected operator-input or transient conditions that were logged/captured as errors despite already having a proper user-facing outcome. Same theme as the AuthSettingsError (#3068) and gaierror (#3132) cleanups.logger.exception('Backup recovery failed')while already returning an "Invalid backup archive" error to the operator. Fixed in both recover entry points that share this handling: the API view (RecoverViewMixin,/api/v1|v2/recover) and the HTML view (settings_recover). → warning.Scheduler.get_next_assetloggederror('Asset not found or processed')on a benign race (operator jumps to a since-deleted / still-processing asset). → warning + names the asset + falls back to the playlist.DownloadError(network timeout, geo-block, private/deleted video, bad URL) was captured by the Celery Sentry integration. The download task'son_failurealready recordsmetadata.error_message, so the operator sees a "Failed" pill. → dropped inbefore_send, matched by name +yt_dlp/yt_dlp.module so a look-alike package can't smuggle its ownDownloadErrorthrough (and yt_dlp isn't imported there).celery.backends.asynchronouslogs "Retry limit exceeded while trying to reconnect to the Celery result store backend" at a fatal level during a sustained redis outage — the same transient-redis noise as the loggers already ignored. →ignore_logger.Each change has a regression test (including both recover entry points). Separately resolved ANTHIAS-3S (
No module named 'channels'from a non-devicesession-*context) as environmental.Validation on real hardware
The
before_senddrops andignore_loggerregistration were confirmed in the real server container on the x86 testbed during the first sweep's validation pass; these are the same mechanism extended to two more exception/logger names. Server-side and arch-independent.Checklist
🤖 Generated with Claude Code