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

[Test failure] <TC_AUTHOR_23>: <Error, when we access the subsection requiring a pre-req> #323

Closed
mdsulemanr opened this issue Oct 26, 2023 · 8 comments
Labels
needs triage release blocker Blocks the upcoming release (fix needed)
Milestone

Comments

@mdsulemanr
Copy link

Release

Quince

Expected behavior

As a learner, a message should be displayed that you need to first attempt another subsection which is a pre-req of the current subsection.

Actual behavior

"An unexpected error occurred. Please click the button below to refresh the page." is occurring

Steps to reproduce

  1. From Studio Advanced Settings, enable Subsection Prerequisites
  2. From Course Outline, mark a subsection that has a graded item in it as Available as a Prerequisite
  3. From Course outline, mark a different subsection as requiring the prerequisite.
  4. Switch to a learner. From LMS, open the subsection requiring a pre-req

Additional information

Screenshot 2023-10-26 164035
Screenshot 2023-10-26 164143
Screenshot 2023-10-26 164219

@mdsulemanr
Copy link
Author

label: quince testing

@mariajgrimaldi mariajgrimaldi added this to the Quince.1 milestone Oct 30, 2023
@mariajgrimaldi
Copy link
Member

Does this work when removing the prerequisite subsection?

@mdsulemanr
Copy link
Author

mdsulemanr commented Nov 30, 2023

@mariajgrimaldi Yes, this works when removing the prerequisite subsection. It also works when we first attempt the pre-requisite subsection with the desired score and completion rate.
It only throws an error or is inaccessible when we try to access the subsection requiring a pre-req without achieving the required completion in the prerequisite subsection.

@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Dec 7, 2023

I believe the chunk-loading error has to do with these reports: #331 #319. So I'll let you know when the fix is merged so we can test this again and discard that idea or mark this issue as solved.

@mariajgrimaldi
Copy link
Member

@mdsulemanr: can you help us test again? Thanks!

@mariajgrimaldi
Copy link
Member

Now when I'm loading a course with prerequisites fails: https://apps.quince.demo.edly.io/learning/course/course-v1:DEMO+adv-v1+2023/home, we're getting an error 500 with the course home API:
image
@regisb: could we get the logs from the server?
And I'm getting this new error when trying to access the prerequisites subsection through a link as a student:
image

@regisb
Copy link
Contributor

regisb commented Dec 10, 2023

I'm unable to reproduce this error. But I can see in the logs that it did occur in the past, at about the time you reported the error:

tutor_local-lms-1  | 2023-12-10 19:09:39,130 INFO 6 [eventtracking.backends.async_routing] [user 10] [ip 186.80.233.57] async_routing.py:41 - [EventEmissionExit] skipping event /api/course_home/outline/course-v1:DEMO+adv-v1+2023
tutor_local-lms-1  | 2023-12-10 19:09:39,131 INFO 6 [tracking] [user 10] [ip 186.80.233.57] logger.py:41 - {"name": "/api/course_home/outline/course-v1:DEMO+adv-v1+2023", "context": {"user_id": 10, "path": "/api/course_home/outline/course-v1:DEMO+adv-v1+2023", "course_id": "", "org_id": "", "enterprise_uuid": ""}, "username": "student", "session": "939bf85f97abb7fa36c18fa6c593d6fc", "ip": "186.80.233.57", "agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0", "host": "quince.demo.edly.io", "referer": "https://apps.quince.demo.edly.io/", "accept_language": "en-US,en;q=0.5", "event": "{\"GET\": {}, \"POST\": {}}", "time": "2023-12-10T19:09:39.130192+00:00", "event_type": "/api/course_home/outline/course-v1:DEMO+adv-v1+2023", "event_source": "server", "page": null}
tutor_local-lms-1  | 2023-12-10 19:09:39,131 INFO 6 [eventtracking.backends.async_routing] [user 10] [ip 186.80.233.57] async_routing.py:41 - [EventEmissionExit] skipping event /api/course_home/outline/course-v1:DEMO+adv-v1+2023
tutor_local-lms-1  | 2023-12-10 19:09:39,233 ERROR 6 [root] [user None] [ip None] signals.py:22 - Uncaught exception from None
tutor_local-lms-1  | Traceback (most recent call last):
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 304, in __getattr__
tutor_local-lms-1  |     return self.fields[field_name]
tutor_local-lms-1  | KeyError: 'self_paced'
tutor_local-lms-1  | 
tutor_local-lms-1  | During handling of the above exception, another exception occurred:
tutor_local-lms-1  | 
tutor_local-lms-1  | Traceback (most recent call last):
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
tutor_local-lms-1  |     response = get_response(request)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
tutor_local-lms-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
tutor_local-lms-1  |   File "/opt/pyenv/versions/3.8.18/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1  |     return func(*args, **kwds)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
tutor_local-lms-1  |     return view_func(*args, **kwargs)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 104, in view
tutor_local-lms-1  |     return self.dispatch(request, *args, **kwargs)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
tutor_local-lms-1  |     response = self.handle_exception(exc)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
tutor_local-lms-1  |     self.raise_uncaught_exception(exc)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
tutor_local-lms-1  |     raise exc
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
tutor_local-lms-1  |     response = handler(request, *args, **kwargs)
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_home_api/outline/views.py", line 240, in get
tutor_local-lms-1  |     course_blocks = get_course_outline_block_tree(request, course_key_string, request.user)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/lib/cache_utils.py", line 74, in decorator
tutor_local-lms-1  |     result = wrapped(*args, **kwargs)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/features/course_experience/utils.py", line 94, in get_course_outline_block_tree
tutor_local-lms-1  |     all_blocks = get_blocks(
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_api/blocks/api.py", line 122, in get_blocks
tutor_local-lms-1  |     blocks = course_blocks_api.get_course_blocks(
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/api.py", line 107, in get_course_blocks
tutor_local-lms-1  |     return get_block_structure_manager(starting_block_usage_key.course_key).get_transformed(
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/manager.py", line 77, in get_transformed
tutor_local-lms-1  |     transformers.transform(block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/transformers.py", line 114, in transform
tutor_local-lms-1  |     self._transform_without_filters(block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/transformers.py", line 140, in _transform_without_filters
tutor_local-lms-1  |     transformer.transform(self.usage_info, block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 95, in transform
tutor_local-lms-1  |     block_structure.remove_block_traversal(lambda block_key: self._is_block_hidden(block_structure, block_key))
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 704, in remove_block_traversal
tutor_local-lms-1  |     self.filter_topological_traversal(
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 729, in filter_topological_traversal
tutor_local-lms-1  |     for _ in self.topological_traversal(filter_func=filter_func, **kwargs):
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/lib/graph_traversals.py", line 329, in _traverse_generic
tutor_local-lms-1  |     should_yield_node = filter_func(current_node)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 685, in retain_or_remove
tutor_local-lms-1  |     if removal_condition(block_key):
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 95, in <lambda>
tutor_local-lms-1  |     block_structure.remove_block_traversal(lambda block_key: self._is_block_hidden(block_structure, block_key))
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 103, in _is_block_hidden
tutor_local-lms-1  |     self_paced = block_structure[block_structure.root_block_usage_key].self_paced
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 306, in __getattr__
tutor_local-lms-1  |     raise AttributeError(f"Field {field_name} does not exist")  # lint-amnesty, pylint: disable=raise-missing-from
tutor_local-lms-1  | AttributeError: Field self_paced does not exist
tutor_local-lms-1  | 2023-12-10 19:09:39,257 INFO 6 [edx.footer] [user 10] [ip 186.80.233.57] api.py:479 - images/logo.png
tutor_local-lms-1  | 2023-12-10 19:09:39,264 ERROR 6 [django.request] [user 10] [ip 186.80.233.57] log.py:241 - Internal Server Error: /api/course_home/outline/course-v1:DEMO+adv-v1+2023
tutor_local-lms-1  | Traceback (most recent call last):
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 304, in __getattr__
tutor_local-lms-1  |     return self.fields[field_name]
tutor_local-lms-1  | KeyError: 'self_paced'
tutor_local-lms-1  | 
tutor_local-lms-1  | During handling of the above exception, another exception occurred:
tutor_local-lms-1  | 
tutor_local-lms-1  | Traceback (most recent call last):
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
tutor_local-lms-1  |     response = get_response(request)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
tutor_local-lms-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
tutor_local-lms-1  |   File "/opt/pyenv/versions/3.8.18/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1  |     return func(*args, **kwds)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
tutor_local-lms-1  |     return view_func(*args, **kwargs)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 104, in view
tutor_local-lms-1  |     return self.dispatch(request, *args, **kwargs)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
tutor_local-lms-1  |     response = self.handle_exception(exc)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
tutor_local-lms-1  |     self.raise_uncaught_exception(exc)
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
tutor_local-lms-1  |     raise exc
tutor_local-lms-1  |   File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
tutor_local-lms-1  |     response = handler(request, *args, **kwargs)
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_home_api/outline/views.py", line 240, in get
tutor_local-lms-1  |     course_blocks = get_course_outline_block_tree(request, course_key_string, request.user)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/lib/cache_utils.py", line 74, in decorator
tutor_local-lms-1  |     result = wrapped(*args, **kwargs)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/features/course_experience/utils.py", line 94, in get_course_outline_block_tree
tutor_local-lms-1  |     all_blocks = get_blocks(
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_api/blocks/api.py", line 122, in get_blocks
tutor_local-lms-1  |     blocks = course_blocks_api.get_course_blocks(
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/api.py", line 107, in get_course_blocks
tutor_local-lms-1  |     return get_block_structure_manager(starting_block_usage_key.course_key).get_transformed(
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/manager.py", line 77, in get_transformed
tutor_local-lms-1  |     transformers.transform(block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/transformers.py", line 114, in transform
tutor_local-lms-1  |     self._transform_without_filters(block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/transformers.py", line 140, in _transform_without_filters
tutor_local-lms-1  |     transformer.transform(self.usage_info, block_structure)
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 95, in transform
tutor_local-lms-1  |     block_structure.remove_block_traversal(lambda block_key: self._is_block_hidden(block_structure, block_key))
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 704, in remove_block_traversal
tutor_local-lms-1  |     self.filter_topological_traversal(
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 729, in filter_topological_traversal
tutor_local-lms-1  |     for _ in self.topological_traversal(filter_func=filter_func, **kwargs):
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/lib/graph_traversals.py", line 329, in _traverse_generic
tutor_local-lms-1  |     should_yield_node = filter_func(current_node)
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 685, in retain_or_remove
tutor_local-lms-1  |     if removal_condition(block_key):
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 95, in <lambda>
tutor_local-lms-1  |     block_structure.remove_block_traversal(lambda block_key: self._is_block_hidden(block_structure, block_key))
tutor_local-lms-1  |   File "/openedx/edx-platform/./lms/djangoapps/course_blocks/transformers/hidden_content.py", line 103, in _is_block_hidden
tutor_local-lms-1  |     self_paced = block_structure[block_structure.root_block_usage_key].self_paced
tutor_local-lms-1  |   File "/openedx/edx-platform/./openedx/core/djangoapps/content/block_structure/block_structure.py", line 306, in __getattr__
tutor_local-lms-1  |     raise AttributeError(f"Field {field_name} does not exist")  # lint-amnesty, pylint: disable=raise-missing-from
tutor_local-lms-1  | AttributeError: Field self_paced does not exist
tutor_local-lms-1  | [pid: 6|app: 0|req: 262/789] 172.18.0.5 () {56 vars in 3037 bytes} [Sun Dec 10 19:09:39 2023] GET /api/course_home/outline/course-v1:DEMO+adv-v1+2023 => generated 9430 bytes in 265 msecs (HTTP/1.1 500) 9 headers in 568 bytes (1 switches on core 0)
tutor_local-lms-1  | 2023-12-10 19:10:48,473 INFO 20 [eventtracking.backends.async_routing] [user 9] [ip 186.80.233.57] async_routing.py:41 - [EventEmissionExit] skipping event /courses/course-v1:DEMO+adv-v1+2023/jump_to/block-v1:DEMO+adv-v1+2023+type@vertical+block@3be6cbbbb7734179b3b38b46eedee3bf

@arbrandes arbrandes added the release blocker Blocks the upcoming release (fix needed) label Dec 11, 2023
@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Dec 11, 2023

I created a course from scratch and trying to load it gave me a 500 error, as I mentioned here: #323 (comment). So today during the BTR meeting we tried reproducing the issue again on the demo server but the prerequisites subsections were working as expected: check this course out

So I'll be closing this now, thanks @arbrandes for the help testing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage release blocker Blocks the upcoming release (fix needed)
Projects
Development

No branches or pull requests

4 participants