New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🤖 Resolve KeyError for missing 'event_id' #66344
🤖 Resolve KeyError for missing 'event_id' #66344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not don't drop messages, we should raise InvalidMessage and DLQ instead
@@ -38,6 +38,9 @@ def exists(self, event: Event) -> bool: | |||
return self.get(key) is not None | |||
|
|||
def store(self, event: Event, unprocessed: bool = False) -> str: | |||
if not event.get('event_id') or not event.get('project'): | |||
logger.error(f\"store method called with event missing 'event_id' or 'project'. Event data: {event}\") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we have a policy around logging every error event in the errors pipeline, but this seems risky
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #66344 +/- ##
===========================================
- Coverage 84.30% 64.40% -19.90%
===========================================
Files 5309 5301 -8
Lines 237200 236738 -462
Branches 41035 40982 -53
===========================================
- Hits 199960 152470 -47490
- Misses 37021 84043 +47022
- Partials 219 225 +6
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
👋 Hi there! This PR was automatically generated 🤖
Fixes SENTRY-14S1
To fix the KeyError caused by a missing 'event_id' in the data dictionary when generating a cache key in the cache_key_for_event function, we will ensure 'event_id' and 'project' keys are present in the data dictionary before calling the function. If the keys are missing, we will add a proper handling mechanism to prevent the application from crashing and log the issue for further investigation.
The steps that were performed:
📣 Instructions for the reviewer which is you, yes you:
This will greatly help us improve the autofix system. Thank you! 🙏
If there are any questions, please reach out to the AI/ML Team on #proj-autofix
🤓 Stats for the nerds:
Prompt tokens: 15307
Completion tokens: 1286
Total tokens: 16593