AJAX requests on forums pages occasionally fail (usually when a request
to the comments service times out), but the user is not made aware of
the failure. This manifests as either the system not appearing to store
state (e.g. if an attempt to flag a post fails) or something taking
forever to load. Now, a modal will pop up to alert the user that a
request has failed and instruct them to reload the page.
In the longer term, we should fix each user gesture that results in an
AJAX call to gracefully handle a failure by resetting the state of the
world appropriately and aleritng the user.
JIRA: FOR-37
I suspect there are very few circumstances that an enrollment event is emitted from the CMS, but if it ever were to happen, it would bomb out because the "crum" middleware is not used in that app. We are hoping to replace this request caching hack in the near future, but for now it is the best option we could come up with.
I noticed the stack appear when I created a new course in my dev environment. Presumably the course author is automatically enrolled in the course, which, causes the tracking code to bomb out. Luckily we catch the error and just log it, but we really should be capturing this type of enrollment event.
XBlock Fragments expect unicode strings, and fail on an assertion when
it isn't:
```
2013-11-14 07:55:50,774 ERROR 3788 [django.request] base.py:215 - Internal Server Error: /courses/TestU/TST101/now/courseware/41d55c576a574fde99319420228f7f88/5fef5794e34842f4a2d45ebcdeaa9a3a/
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 75, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/views.py", line 407, in index
context['fragment'] = section_module.render('student_view')
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 156, in render
return self.runtime.render(self, view, context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 903, in render
return block.xmodule_runtime.render(to_render, view_name, context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 356, in render
frag = view_fn(context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 77, in student_view
rendered_child = child.render('student_view', context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 156, in render
return self.runtime.render(self, view, context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 903, in render
return block.xmodule_runtime.render(to_render, view_name, context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 356, in render
frag = view_fn(context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/vertical_module.py", line 27, in student_view
rendered_child = child.render('student_view', context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 156, in render
return self.runtime.render(self, view, context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 903, in render
return block.xmodule_runtime.render(to_render, view_name, context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 356, in render
frag = view_fn(context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 464, in student_view
return Fragment(self.get_html())
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/fragment.py", line 34, in __init__
self.add_content(content)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/fragment.py", line 71, in add_content
assert isinstance(content, unicode)
AssertionError
```