Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Mature filter is broken #728

Closed
1 task
AetherUnbound opened this issue May 31, 2022 · 1 comment · Fixed by #730
Closed
1 task

Mature filter is broken #728

AetherUnbound opened this issue May 31, 2022 · 1 comment · Fixed by #730
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP 🔧 tech: django Requires familiarity with Django 🐍 tech: python Requires familiarity with Python

Comments

@AetherUnbound
Copy link
Contributor

Description

The mature flag on our API is currently failing.

Here's the stacktrace we're seeing

AttributeError: 'NoneType' object has no attribute 'to_dict'
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "catalog/api/views/media_views.py", line 68, in list
    results, num_pages, num_results = perform_search(
  File "catalog/api/controllers/elasticsearch/search.py", line 166, in perform_search
    start, end = get_query_slice(
  File "catalog/api/controllers/elasticsearch/utils.py", line 88, in get_query_slice
    start_slice, end_slice = paginate_with_dead_link_mask(s, page_size, page)
  File "catalog/api/controllers/elasticsearch/utils.py", line 58, in paginate_with_dead_link_mask
    query_hash = get_query_hash(s)
  File "catalog/api/utils/dead_link_mask.py", line 21, in get_query_hash
    serialized_search_obj = s.to_dict()
  File "elasticsearch_dsl/search.py", line 658, in to_dict
    d["query"] = self.query.to_dict()
  File "elasticsearch_dsl/utils.py", line 382, in to_dict
    value = list(map(lambda x: x.to_dict(), value))
  File "elasticsearch_dsl/utils.py", line 382, in <lambda>
    value = list(map(lambda x: x.to_dict(), value))

Reproduction

  1. Visit http://localhost:8000/v1/images/?mature=true
  2. Observe 500 error

Additional context

Sentry issue: https://sentry.io/share/issue/84aad5fd22354d20844f9fd5873958be/

Resolution

  • 🙋 I would be interested in resolving this bug.
@AetherUnbound AetherUnbound added 🐍 tech: python Requires familiarity with Python 💻 aspect: code Concerns the software code in the repository 🔧 tech: django Requires familiarity with Django 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP labels May 31, 2022
@AetherUnbound AetherUnbound self-assigned this May 31, 2022
@AetherUnbound AetherUnbound removed their assignment May 31, 2022
@stacimc stacimc self-assigned this May 31, 2022
@AetherUnbound
Copy link
Contributor Author

This is no longer causing an issue as of v2.5.4 - we'll need to monitor this when we try to re-instate #699

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP 🔧 tech: django Requires familiarity with Django 🐍 tech: python Requires familiarity with Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants