Skip to content

Altering leaderboard columns breaks a live contest. No additional saves can be made #1600

Closed

Description

@chansmi

I was working with Ihsan and we made changes to the leaderboard columns. Specifically removing the columns. Everthing seemed to work properly but not I can't make any changes to the site. Trying to save any changes, even small, results in the following console error.

Live contest: https://www.codabench.org/competitions/edit/3888/#/pages

Screenshot 2024-09-27 at 4 09 36 PM

Activity

  1. Didayolo commented on Sep 27, 2024

    @Didayolo
    Member

    Here are the error logs when trying to save.

    codabench-django-1         | Internal Server Error: /api/competitions/3888/
    codabench-django-1         | Traceback (most recent call last):
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
    codabench-django-1         |     response = get_response(request)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 115, in _get_response
    codabench-django-1         |     response = self.process_exception_by_middleware(e, request)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 113, in _get_response
    codabench-django-1         |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    codabench-django-1         |     return view_func(*args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/viewsets.py", line 116, in view
    codabench-django-1         |     return self.dispatch(request, *args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 495, in dispatch
    codabench-django-1         |     response = self.handle_exception(exc)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 455, in handle_exception
    codabench-django-1         |     self.raise_uncaught_exception(exc)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 492, in dispatch
    codabench-django-1         |     response = handler(request, *args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/mixins.py", line 84, in partial_update
    codabench-django-1         |     return self.update(request, *args, **kwargs)
    codabench-django-1         |   File "/app/src/apps/api/views/competitions.py", line 262, in update
    codabench-django-1         |     leaderboard.save()
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/drf_writable_nested/mixins.py", line 230, in save
    codabench-django-1         |     return super(BaseNestedModelSerializer, self).save(**kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 183, in save
    codabench-django-1         |     assert not self.errors, (
    codabench-django-1         | AssertionError: You cannot call `.save()` on a serializer with invalid data.
    codabench-django-1         | Internal Server Error: /api/competitions/3888/
    codabench-django-1         | Traceback (most recent call last):
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
    codabench-django-1         |     response = get_response(request)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 115, in _get_response
    codabench-django-1         |     response = self.process_exception_by_middleware(e, request)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 113, in _get_response
    codabench-django-1         |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    codabench-django-1         |     return view_func(*args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/viewsets.py", line 116, in view
    codabench-django-1         |     return self.dispatch(request, *args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 495, in dispatch
    codabench-django-1         |     response = self.handle_exception(exc)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 455, in handle_exception
    codabench-django-1         |     self.raise_uncaught_exception(exc)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 492, in dispatch
    codabench-django-1         |     response = handler(request, *args, **kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/mixins.py", line 84, in partial_update
    codabench-django-1         |     return self.update(request, *args, **kwargs)
    codabench-django-1         |   File "/app/src/apps/api/views/competitions.py", line 262, in update
    codabench-django-1         |     leaderboard.save()
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/drf_writable_nested/mixins.py", line 230, in save
    codabench-django-1         |     return super(BaseNestedModelSerializer, self).save(**kwargs)
    codabench-django-1         |   File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 183, in save
    codabench-django-1         |     assert not self.errors, (
    codabench-django-1         | AssertionError: You cannot call `.save()` on a serializer with invalid data.
  2. Didayolo commented on Sep 27, 2024

    @Didayolo
    Member

    The first column "Avg Focal Per Capita" was previously set as an average between the two other columns.
    When you removed the two other columns, this computation was missing its columns and the setting got invalid.
    I replaced the "Average" mode by simply calling an "avg_focal_per_capita" key for this column.

    Not sure if you want to have the two other columns and compute an average, or to use this key as I did right now.
    The key "avg_focal_per_capita" means that the scoring program must output a score associated with this key.

    It is now possible to make live changes and to save the competition.

  3. Didayolo commented on Sep 27, 2024

    @Didayolo
    Member

    Regarding this issue, it should not have been possible to save the leaderboard setting after removed columns used by a "computation column".

  4. changed the title [-]Urgent: Altering leaderboard columns breaks a live contest. No additional saves can be made[/-] [+]Altering leaderboard columns breaks a live contest. No additional saves can be made[/+] on Sep 27, 2024
  5. Didayolo commented on Sep 27, 2024

    @Didayolo
    Member

    I need to detail the issue but basically there is a strange behavior here:

    1. I set up the column to use key instead of computation
    2. Save
    3. Come back to the editor and the column is using computation again
  6. self-assigned this
    on Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions