hypothesis / h

Annotate with anyone, anywhere.
https://hypothes.is/
BSD 2-Clause "Simplified" License
2.96k stars 427 forks source link

Invalid groups in the production h DB cause admin pages to crash #9012

Closed sentry-io[bot] closed 1 month ago

sentry-io[bot] commented 1 month ago

Sentry Issue: H-2TC

ValueError: This group doesn't seem to match any known type of group. This shouldn't be in the database!
(25 additional frame(s) were not displayed)
...
  File "h/viewderivers.py", line 30, in wrapper_view
    resp = view(context, request)
  File "/var/lib/hypothesis/h/templates/admin/groups.html.jinja2", line 6, in top-level template code
    {% set page_title = 'Groups' %}
  File "/var/lib/hypothesis/h/templates/layouts/admin.html.jinja2", line 65, in top-level template code
    {% block content %}{% endblock %}
  File "/var/lib/hypothesis/h/templates/admin/groups.html.jinja2", line 30, in block 'content'
    {% if group.type in ('open', 'restricted') %}
  File "h/models/group.py", line 208, in type
    raise ValueError(
seanh commented 1 month ago

Fixed by deleting the groups from the DB: https://hypothes-is.slack.com/archives/C4K6M7P5E/p1728658787530409