[16.0][sentry] sentry_ignore_exceptions is not applied to the exceptions logged without exc_info
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Start with sentry/hooks.py and inspect before_send, then compare how sentry_ignore_exceptions is configured with the fixed const.DEFAULT_IGNORED_EXCEPTIONS check for log records without exc_info. The issue names odoo/http.py (Application.__call__) and says it is opening a pull request with tests; check that work before starting. Done means the configured ignored exceptions behave the same with and without exc_info, including the listed ValidationError and UserError cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Module
sentry 16.0.3.0.3. The same code is in 17.0, 18.0 and 19.0.
Describe the bug
Odoo logs the UserError and AccessError of a request, and their subclasses such as ValidationError, with _logger.warning(exc): the exception is the message of the log record and there is no exc_info (odoo/http.py, Application.__call__).
sentry_ignore_exceptions is applied by sentry_sdk (ignore_errors) only to the events that have an exc_info. For the log records without exc_info, before_send in sentry/hooks.py drops the exception by the fixed list const.DEFAULT_IGNORED_EXCEPTIONS, not by the option.
So the option has no effect on these exceptions: setting sentry_ignore_exceptions empty, or to a list without ValidationError, does not let a ValidationError raised in a request reach Sentry. It is still dropped.
To Reproduce
Calling the before_send of the module with a log record that has a ValidationError or a UserError as message, with the option set to different values:
sentry_ignore_exceptions |
ValidationError |
UserError |
|---|---|---|
| empty | dropped | dropped |
odoo.exceptions.AccessDenied |
dropped | dropped |
odoo.exceptions.ValidationError |
dropped | dropped |
The same with a real request: with sentry_logging_level = warn and sentry_ignore_exceptions empty, a button that raises a ValidationError logs WARNING odoo.http: <message>, and no event is sent.
Expected behavior
The configured sentry_ignore_exceptions is applied the same way with and without exc_info.
Additional context
- The hardcoded check explains why raising a
UserErroris never sent, but it also makes the option look broken for anybody who wants to send some of them. - The table of
readme/CONFIGURE.rstnames the optionsentry_ignored_exceptions, while the code readssentry_ignore_exceptions(and the example configuration of the same file uses the second name). - A very old related discussion: #792.
I am opening a pull request with a fix (the log records are checked against the ignore_errors list of the client) and tests.
- Lingua principale
- Python
- Stelle
- 960
- Fork
- 1.7k
- Merge medio
- 7g 2h
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OCA/server-tools
-
When tracking Json fields an error pops in v19Forse già presa @xecanto l’ha presa 9 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OCA/server-tools#3796 ·
I maintainer di solito rispondono entro 1 giorno
-
[18.0] base_exception: swallow_base_exception_error never runs the decorated testForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OCA/server-tools#3784 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[17.0] auto_backup: Cron: Database backup failed, UnicodeDecodeError: utf-8 codec can't decode byte 0x8b in position 690: invalid start byteForse già presa @xecanto l’ha presa 20 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OCA/server-tools#3768 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
OCA/server-tools#3368 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
OCA/server-tools#3139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OCA/server-tools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug(sdk): add_toleration_json silently drops camelCase tolerationSeconds for static dict/list inputForse già presa @ravikumar266 l’ha presa oggi. Apertaarea/sdk kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kubeflow/pipelines#15347 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
predict_file with crop_model duplicates predictions once per imageForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
weecology/DeepForest#1445 ·
-
agent-ready priority: medium status: ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
melodic-software/claude-code-plugins#11864 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PolicyEngine/policyengine-uk#2785 ·
I maintainer di solito rispondono entro 2 giorni