Ottomata has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/389861 )
Change subject: Add exception guard for json parsing in eventlogging mysql filter ...................................................................... Add exception guard for json parsing in eventlogging mysql filter This is temporary to help with transition as part of T179625. This will be removed in https://gerrit.wikimedia.org/r/#/c/389722/ anyway. Bug: T179625 Change-Id: I5313147c8520556ecd34c389367e785ea37d959d --- M modules/eventlogging/files/filters.py 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/61/389861/1 diff --git a/modules/eventlogging/files/filters.py b/modules/eventlogging/files/filters.py index e411a89..3c5e994 100644 --- a/modules/eventlogging/files/filters.py +++ b/modules/eventlogging/files/filters.py @@ -11,7 +11,14 @@ if 'userAgent' not in e: return True - user_agent_dict = json.loads(e['userAgent']) + try: + user_agent_dict = json.loads(e['userAgent']) + except ValueError: + if isinstance(e['userAgent'], str): + return True + # MySQL doesn't know how to insert a non string UA! + else: + return False is_bot = user_agent_dict.get('is_bot', False) is_mediawiki = user_agent_dict.get('is_mediawiki', False) -- To view, visit https://gerrit.wikimedia.org/r/389861 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5313147c8520556ecd34c389367e785ea37d959d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
