There are varying opinions on what and how to log things, and there are definitely people who think it’s fine to log “normal” situations as errors, with full stack traces in the logs. This can cause issues, however, with very complicated projects like openedx!
I am trying to set up openedx in a non-standard way, which means I am extremely reliant on things like errors appearing in logs to know whether I am doing stuff right or wrong.
I am trying to use the management commands to import generated OLX courses, and turned to the logs to see what was going on. Alas, I saw many dozens of errors in the cms-worker logs
. In order to debug fully, I installed a new platform from a completely fresh, pure tutor installation, created a user, then logged in to create a course in the interface. Upon creating a course in the UI, I again saw many dozens of full stacktraces in the cms-worker logs.
An example is:
cms-worker-1 | [2025-10-22 02:58:52,976: ERROR/ForkPoolWorker-7] Task openedx.core.djangoapps.bookmarks.tasks.update_xblocks_cache[23f71267-13b
d-4141-b698-3b5f62e7cb4c] raised unexpected: AttributeError("'NoneType' object has no attribute 'has_children'")
cms-worker-1 | Traceback (most recent call last):
cms-worker-1 | File "/openedx/venv/lib/python3.11/site-packages/celery/app/trace.py", line 453, in trace_task
cms-worker-1 | R = retval = fun(*args, **kwargs)
cms-worker-1 | ^^^^^^^^^^^^^^^^^^^^
cms-worker-1 | File "/openedx/venv/lib/python3.11/site-packages/celery/app/trace.py", line 736, in __protected_call__
cms-worker-1 | return self.run(*args, **kwargs)
cms-worker-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
cms-worker-1 | File "/openedx/venv/lib/python3.11/site-packages/edx_django_utils/monitoring/internal/code_owner/utils.py", line 195, in new_f
unction
cms-worker-1 | return wrapped_function(*args, **kwargs)
cms-worker-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-worker-1 | File "/openedx/edx-platform/openedx/core/djangoapps/bookmarks/tasks.py", line 163, in update_xblocks_cache
cms-worker-1 | _update_xblocks_cache(course_key)
cms-worker-1 | File "/openedx/edx-platform/openedx/core/djangoapps/bookmarks/tasks.py", line 115, in _update_xblocks_cache
cms-worker-1 | blocks_data = _calculate_course_xblocks_data(course_key)
cms-worker-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-worker-1 | File "/openedx/edx-platform/openedx/core/djangoapps/bookmarks/tasks.py", line 35, in _calculate_course_xblocks_data
cms-worker-1 | children = current_block.get_children() if current_block.has_children else []
cms-worker-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-worker-1 | AttributeError: 'NoneType' object has no attribute 'has_children'
Is this sort of error expected/desired in the FOSS tutor/openedx version? Are they historical? If so, is there any simple way to differentiate between these expected errors and unexpected errors?
If not, would it be worth creating a GH issue to try and reduce the noise?
Thanks!