[18.0][FIX] sentry: event dropped if include_context key not present - #3342
Merged
OCA-git-bot merged 1 commit intoAug 20, 2025
Conversation
Contributor
|
Hi @moylop260, @naglis, @fernandahf, @versada, @barsi, |
StefanRijnhart
force-pushed
the
18.0-sentry-fix_event_dropped_when_key_not_present
branch
from
August 12, 2025 08:35
688b20e to
cfec327
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Fixes
```
File "/home/odoo/.local/lib/python3.12/site-packages/sentry_sdk/client.py", line 595, in _prepare_event
new_event = before_send(event, hint or {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/user/oca-server-tools/sentry/hooks.py", line 66, in before_send
if event.setdefault("tags", {})["include_context"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'include_context'
2025-07-08 14:45:45,907 14296 INFO quatra-18-0-development-21441249 sentry_sdk.errors: before send dropped event
```
Error is only logged when running Sentry in debug mode, otherwise events are dropped silently.
StefanRijnhart
force-pushed
the
18.0-sentry-fix_event_dropped_when_key_not_present
branch
from
August 14, 2025 20:32
cfec327 to
9b36741
Compare
Contributor
|
/ocabot merge patch |
Contributor
|
What a great day to merge this nice PR. Let's do it! |
Contributor
|
Congratulations, your PR was merged at cbc00c9. Thanks a lot for contributing to OCA. ❤️ |
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.
In our (Odoo.sh) setup, we were missing almost all events after migrating to Odoo 18. With this fix, the events were back.
Fixes
NB. This error is only logged when running Sentry in debug mode, otherwise events are dropped silently.