[FIX] sentry: start on sentry-sdk newer than 1.9.0 - #12
Merged
yibudak merged 1 commit intoSep 14, 2026
Merged
Conversation
sentry-sdk renamed two client options after 1.9.0: with_locals became include_local_variables and request_bodies became max_request_body_size. get_sentry_options() indexed DEFAULT_OPTIONS by the old names, so any newer SDK made post_load raise KeyError: 'with_locals' and the server never started. renamed_option() picks whichever name the installed SDK knows, so the module runs on 1.9.0 and on the 1.45 line alike, and the manifest pin becomes sentry_sdk<2 (2.x drops sentry_sdk._compat, which processor.py and logutils.py still import). An odoo.conf that sets sentry_with_locals or sentry_request_bodies has to switch to the new names once the SDK is upgraded. Same problem as OCA#3104 and OCA#3105, kept compatible with both SDK generations so the module and the SDK can be deployed in either order. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017v5D6URyGjKniyPfghTuvy
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.
Production stopped on 14 September after the deploy installed
sentry-sdk1.45.1 (altinkaya-opensource/odoo#753, reverted in OCA#763):Cause
get_sentry_options()indexessentry_sdk.consts.DEFAULT_OPTIONSwith the 1.9.0 option names. sentry-sdk renamed two of them after that release:with_localsis nowinclude_local_variablesandrequest_bodiesis nowmax_request_body_size.post_loadruns at every server start whensentry_enabledis set, so any newer SDK kills the process before the registry loads. That is why OCA pinssentry_sdk<=1.9.0on 16.0 and 17.0; 18.0 moved to sentry-sdk 2.x with the new names. OCA#3104 and OCA#3105 fix the same two keys on 16.0 and are still open.Change
const.py:renamed_option(new_key, old_key)returns the option under whichever name the installed SDK has. Both entries use it, so the module runs on 1.9.0 and on the 1.45 line, and you can deploy the module and the SDK in either order.__manifest__.py: pinsentry_sdk<2(2.x dropssentry_sdk._compat, whichprocessor.pyandlogutils.pystill import), version 16.0.3.0.4.An
odoo.confthat setssentry_with_localsorsentry_request_bodieshas to switch to the new names once the SDK is upgraded; a newer SDK ignores the old keys.Verified
The module's 15 tests, which call
initialize_sentrywith a config, on a 16.0 database:utcfromtimestampwarnings in the logDeploy this before re-applying the
sentry-sdk==1.45.1bump in the odoo repository.🤖 Generated with Claude Code
https://claude.ai/code/session_017v5D6URyGjKniyPfghTuvy