Skip to content

fix: python-dateutil version issue#30530

Merged
mumarkhan999 merged 1 commit intomasterfrom
bom-2245-attempt-4
Jun 7, 2022
Merged

fix: python-dateutil version issue#30530
mumarkhan999 merged 1 commit intomasterfrom
bom-2245-attempt-4

Conversation

@mumarkhan999
Copy link
Contributor

When the previous PR 30255 was deployed we got the following error

May 31 15:56:21 ip-10-2-10-225 [service_variant=lms][root][env:prod-edx-edxapp] ERROR [ip-10-2-10-225  1323] [user None] [ip None] [signals.py:22] - Uncaught exception from None
Traceback (most recent call last):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/newrelic/hooks/framework_django.py", line 552, in wrapper
    return wrapped(*args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/util/maintenance_banner.py", line 42, in _decorated
    return func(request, *args, **kwargs)
  File "/edx/app/edxapp/edx-platform/common/djangoapps/student/views/dashboard.py", line 866, in student_dashboard
    for url in get_resume_urls_for_enrollments(user, course_enrollments).values():
  File "/edx/app/edxapp/edx-platform/common/djangoapps/student/helpers.py", line 776, in get_resume_urls_for_enrollments
    block_data = get_course_blocks(user, block_key)
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/course_blocks/api.py", line 107, in get_course_blocks
    return get_block_structure_manager(starting_block_usage_key.course_key).get_transformed(
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/manager.py", line 78, in get_transformed
    transformers.transform(block_structure)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/transformers.py", line 113, in transform
    self._transform_with_filters(block_structure)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/transformers.py", line 132, in _transform_with_filters
    block_structure.filter_topological_traversal(combined_filters)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/block_structure.py", line 743, in filter_topological_traversal
    for _ in self.topological_traversal(filter_func=filter_func, **kwargs):
  File "/edx/app/edxapp/edx-platform/openedx/core/lib/graph_traversals.py", line 329, in _traverse_generic
    should_yield_node = filter_func(current_node)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/transformer.py", line 228, in <lambda>
    return lambda block_key: accumulated(block_key) and additional(block_key)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/transformer.py", line 228, in <lambda>
    return lambda block_key: accumulated(block_key) and additional(block_key)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content/block_structure/block_structure.py", line 699, in retain_or_remove
    if removal_condition(block_key):
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/course_blocks/transformers/start_date.py", line 99, in <lambda>
    removal_condition = lambda block_key: not check_start_date(
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access_utils.py", line 90, in check_start_date
    if now > effective_start:
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/dateutil/tz/tz.py", line 222, in utcoffset
    if self._isdst(dt):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/dateutil/tz/tz.py", line 287, in _isdst
    if not self._hasdst:
AttributeError: 'tzlocal' object has no attribute '_hasdst'

We didn't apply the patch on method
https://github.com/openedx/edx-platform/blob/3492bede446e4523ee09f965b7639b55af0472d0/openedx/core/djangoapps/content/block_structure/block_structure.py#L550
of class

https://github.com/openedx/edx-platform/blob/3492bede446e4523ee09f965b7639b55af0472d0/openedx/core/djangoapps/content/block_structure/block_structure.py#L398

Now we have applied the patch on the mentioned method as well. Also we've added some temporary log statements to do testing. These log statemetns will be removed later on.

@mumarkhan999 mumarkhan999 force-pushed the bom-2245-attempt-4 branch 3 times, most recently from 6f90705 to db36ca8 Compare June 2, 2022 13:30
@mumarkhan999 mumarkhan999 force-pushed the bom-2245-attempt-4 branch 5 times, most recently from a907889 to d40445f Compare June 3, 2022 08:48
@mumarkhan999 mumarkhan999 merged commit 2902363 into master Jun 7, 2022
@mumarkhan999 mumarkhan999 deleted the bom-2245-attempt-4 branch June 7, 2022 11:27
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments