fix: don't submit success=True when YouTube channel data is None#154
Merged
Conversation
When eval_youtube() fails to retrieve channel data (API error, token expired, channel suspended), it returns early with yt_account.details = None. Previously, _process_youtube_account() wrapped this in an AccountResult with success=True, causing db_ingestion's mapper to crash on the None value (DB_INGESTION-1, 216 events since May 26). Now detects the None details case and returns an error result with success=False and a descriptive message, so db_ingestion can skip it cleanly instead of crashing.
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.
Problem
Sentry issue DB_INGESTION-1 — 216 errors since May 26, still ongoing.
https://bitcast.sentry.io/issues/DB_INGESTION-1
When eval_youtube() fails to retrieve channel data (API error, token expired, channel suspended), it returns early with yt_account.details = None. Previously, _process_youtube_account() wrapped this in an AccountResult with success=True, causing db_ingestion's mapper to crash on the None value.
All 216 events are from a single validator hotkey (5DAoDtMxVqtMu2Nd5E7QhPEGXDMgrySvE1b3rRT5ARDhfNNK) that consistently submits empty account data with success: True.
Fix
In youtube_evaluator.py:_process_youtube_account(), detect the None details case and return an AccountResult.create_error_result() with success=False and a descriptive error message. This way db_ingestion can skip the payload cleanly instead of crashing.
Companion PR
bitcast-network/db_ingestion — defensive guard in the mapper (defense-in-depth)
Fixes DB_INGESTION-1