mitodl / edx-platform

The Open edX platform, the software that powers edX!
http://open.edx.org/
GNU Affero General Public License v3.0
6 stars 1 forks source link

`completion.enable_completion_tracking` waffle switch crashes the dashboard #304

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Steps to Reproduce

  1. Turn on the waffle flag completion.enable_completion_tracking at https://lms-ci.mitx.mit.edu/admin/waffle/switch/2/change/
  2. go to https://lms-ci.mitx.mit.edu/dashboard

Sentry Issue: OPENEDX-RESIDENTIAL-5GA

AttributeError: 'str' object has no attribute 'id'
(20 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]

AttributeError: 'str' object has no attribute 'id'
(19 additional frame(s) were not displayed)
...
  File "navbar-authenticated.html.py", line 118, in render_body
    runtime._include_file(context, 'user_dropdown.html', _template_uri)
  File "mako/runtime.py", line 793, in _include_file
    callable_(ctx, **kwargs)
  File "user_dropdown.html.py", line 56, in render_body
    resume_block = retrieve_last_sitewide_block_completed(username)
  File "openedx/core/djangoapps/user_api/accounts/utils.py", line 127, in retrieve_last_sitewide_block_completed
    latest_completions_by_course = BlockCompletion.latest_blocks_completed_all_courses(user)
  File "completion/models.py", line 272, in latest_blocks_completed_all_courses
    [user.id, user.id]
pdpinch commented 1 year ago

Could this be an issue with our theme? https://github.com/mitodl/mitx-theme/

In particular, https://github.com/mitodl/mitx-theme/blob/master/lms/templates/header/navbar-authenticated.html

arslanashraf7 commented 1 year ago

The fix PR is https://github.com/mitodl/mitx-theme/pull/137.

I'm suspecting that we probably turned on the completion switch very recently for residential because the change that the theme needed to fix was something that should have raised errors long ago if we'd turned the switch. The completion functionality was changed some time ago in platform and in the completion app to expect the user instance instead of a username string.

arslanashraf7 commented 1 year ago

Closed via https://github.com/mitodl/mitx-theme/pull/137