Internal Server Error when adding substitution #206

Closed
opened 2023-03-24 13:23:28 +01:00 by nik · 5 comments
Owner

On sis2.c-b-e-s.de, entering substitutions currently raises an internal server error.

Internal Server Error: /django/app/chronos/lessons/642/12/substitution/
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/rules/contrib/views.py", line 231, in _wrapped_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aleksis/apps/chronos/views.py", line 295, in edit_substitution
    if edit_substitution_form.is_valid():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 205, in is_valid
    return self.is_bound and not self.errors
                                 ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 200, in errors
    self.full_clean()
  File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 439, in full_clean
    self._post_clean()
  File "/usr/local/lib/python3.11/dist-packages/django/forms/models.py", line 492, in _post_clean
    self.instance.full_clean(exclude=exclude, validate_unique=False)
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 1472, in full_clean
    self.validate_constraints(exclude=exclude)
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 1423, in validate_constraints
    constraint.validate(model_class, self, exclude=exclude, using=using)
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/constraints.py", line 92, in validate
    if not Q(self.check).check(against, using=using):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/query_utils.py", line 141, in check
    return compiler.execute_sql(SINGLE) is not None
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/cachalot/monkey_patch.py", line 37, in inner
    return original(compiler, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/cachalot/monkey_patch.py", line 92, in inner
    table_cache_keys = _get_table_cache_keys(compiler)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/cachalot/utils.py", line 276, in _get_table_cache_keys
    for t in _get_tables(db_alias, compiler.query, compiler)]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/cachalot/utils.py", line 220, in _get_tables
    tables.add(query.get_meta().db_table)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'db_table'
On `sis2.c-b-e-s.de`, entering substitutions currently raises an internal server error. ```plain Internal Server Error: /django/app/chronos/lessons/642/12/substitution/ Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func response = view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/rules/contrib/views.py", line 231, in _wrapped_view return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aleksis/apps/chronos/views.py", line 295, in edit_substitution if edit_substitution_form.is_valid(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 205, in is_valid return self.is_bound and not self.errors ^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 200, in errors self.full_clean() File "/usr/local/lib/python3.11/dist-packages/django/forms/forms.py", line 439, in full_clean self._post_clean() File "/usr/local/lib/python3.11/dist-packages/django/forms/models.py", line 492, in _post_clean self.instance.full_clean(exclude=exclude, validate_unique=False) File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 1472, in full_clean self.validate_constraints(exclude=exclude) File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 1423, in validate_constraints constraint.validate(model_class, self, exclude=exclude, using=using) File "/usr/local/lib/python3.11/dist-packages/django/db/models/constraints.py", line 92, in validate if not Q(self.check).check(against, using=using): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/db/models/query_utils.py", line 141, in check return compiler.execute_sql(SINGLE) is not None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/cachalot/monkey_patch.py", line 37, in inner return original(compiler, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/cachalot/monkey_patch.py", line 92, in inner table_cache_keys = _get_table_cache_keys(compiler) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/cachalot/utils.py", line 276, in _get_table_cache_keys for t in _get_tables(db_alias, compiler.query, compiler)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/cachalot/utils.py", line 220, in _get_tables tables.add(query.get_meta().db_table) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'db_table' ```
Member

Fix: update cachalot

Fix: update cachalot
Member

assigned to @leuckeju

assigned to @leuckeju
Member

mentioned in issue AlekSIS-Core#845

mentioned in issue AlekSIS-Core#845
Member

mentioned in merge request AlekSIS-Core!1525

mentioned in merge request AlekSIS-Core!1525
Member

fixed in the core release-3.0 branch

fixed in the core release-3.0 branch
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-Chronos#206
No description provided.