Skip to content
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

Add better defensive checks and error tracking on exercise publishing #4163

Closed
bjester opened this issue Jun 21, 2023 · 1 comment
Closed
Assignees
Labels
P0 - critical Priority: Release blocker or regression

Comments

@bjester
Copy link
Member

bjester commented Jun 21, 2023

Observed behavior

The following issue occurred publishing a channel on production. Although, we never received a report of the issue in our Sentry monitoring:

Traceback (most recent call last):
  File \"/contentcuration/contentcuration/contentcuration/viewsets/base.py\", line 920, in create_change_tracker
    yield tracker
  File \"/contentcuration/contentcuration/contentcuration/viewsets/channel.py\", line 490, in publish
    channel = publish_channel(
  File \"/usr/local/lib/python3.9/contextlib.py\", line 79, in inner
    return func(*args, **kwds)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 842, in publish_channel
    kolibri_temp_db = create_content_database(channel, force, user_id, force_exercises, progress_tracker=progress_tracker)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 130, in create_content_database
    tree_mapper.map_nodes()
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 200, in map_nodes
    self.recurse_nodes(self.root_node, {})
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 237, in recurse_nodes
    self.recurse_nodes(child, metadata)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 237, in recurse_nodes
    self.recurse_nodes(child, metadata)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 237, in recurse_nodes
    self.recurse_nodes(child, metadata)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 229, in recurse_nodes
    exercise_data = process_assessment_metadata(node, kolibrinode)
  File \"/contentcuration/contentcuration/contentcuration/utils/publish.py\", line 482, in process_assessment_metadata
    exercise_data = extra_fields.get('options').get('completion_criteria').get('threshold')
AttributeError: 'NoneType' object has no attribute 'get'

Expected behavior

  1. We get alerted to these types of errors
  2. We have better logging and defensive checks against malformed data (which get is the problem and on which node?)
@bjester bjester self-assigned this Jun 21, 2023
@bjester bjester added the P0 - critical Priority: Release blocker or regression label Jun 21, 2023
@bjester bjester added this to the Studio: next major release milestone Jun 21, 2023
@bjester
Copy link
Member Author

bjester commented Jul 5, 2023

Followup issue added and PR for immediate fix merged #4174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 - critical Priority: Release blocker or regression
Projects
None yet
Development

No branches or pull requests

1 participant