Skip to content

Conversation

dtuantran and others added 17 commits August 21, 2023 15:45
* give access of server status page to all users

* unused import removed

* button added in queue page to go to server status page
upgrade rabbitmq always to the latest management version
Revert "upgrade rabbitmq always to the latest management version"
* task update test added for submission

* circle ci space resolved
* competition model updated with reward, contact email and report

* reward functionality added

* contact email and report functionality added

* report url style changed

* forum contact email color changed

* 0026 migation updated

---------

Co-authored-by: Adrien Pavão <adrien.pavao@gmail.com>
Leaderboard Download - 500 error resolved
Forum -  usernames are clickable links
Serves status - Queue added in submission
@Didayolo
Copy link
Member Author

Didayolo commented Aug 24, 2023

@ihsaan-ullah Not sure from where it comes from, but in the test server, when I try to save a profile picture in my profile, it fails.

I may be due to the migration config #1109

I can find these logs:

codabench-django-1       | Internal Server Error: /api/users/6/
codabench-django-1       | Traceback (most recent call last):
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
codabench-django-1       |     return self.cursor.execute(sql, params)
codabench-django-1       | psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "profiles_user_display_name_key"
codabench-django-1       | DETAIL:  Key (display_name)=() already exists.
codabench-django-1       | 
codabench-django-1       | 
codabench-django-1       | The above exception was the direct cause of the following exception:
codabench-django-1       | 
codabench-django-1       | Traceback (most recent call last):
codabench-django-1       |   File "/usr/local/lib/python3.8/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.8/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.8/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.8/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.8/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.8/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.8/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.8/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.8/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/profiles.py", line 42, in update
codabench-django-1       |     instance = serializer.save()
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 209, in save
codabench-django-1       |     self.instance = self.update(self.instance, validated_data)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 986, in update
codabench-django-1       |     instance.save()
codabench-django-1       |   File "/app/src/apps/profiles/models.py", line 83, in save
codabench-django-1       |     super().save(*args, **kwargs)
codabench-django-1       |   File "/app/src/apps/chahub/models.py", line 109, in save
codabench-django-1       |     super().save(*args, **kwargs)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/base_user.py", line 66, in save
codabench-django-1       |     super().save(*args, **kwargs)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 743, in save
codabench-django-1       |     self.save_base(using=using, force_insert=force_insert,
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 780, in save_base
codabench-django-1       |     updated = self._save_table(
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 853, in _save_table
codabench-django-1       |     updated = self._do_update(base_qs, using, pk_val, values, update_fields,
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 903, in _do_update
codabench-django-1       |     return filtered._update(values) > 0
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 760, in _update
codabench-django-1       |     return query.get_compiler(self.db).execute_sql(CURSOR)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1471, in execute_sql
codabench-django-1       |     cursor = super().execute_sql(result_type)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
codabench-django-1       |     cursor.execute(sql, params)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 67, in execute
codabench-django-1       |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
codabench-django-1       |     return executor(sql, params, many, context)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
codabench-django-1       |     return self.cursor.execute(sql, params)
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 89, in __exit__
codabench-django-1       |     raise dj_exc_value.with_traceback(traceback) from exc_value
codabench-django-1       |   File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
codabench-django-1       |     return self.cursor.execute(sql, params)
codabench-django-1       | django.db.utils.IntegrityError: duplicate key value violates unique constraint "profiles_user_display_name_key"
codabench-django-1       | DETAIL:  Key (display_name)=() already exists.

@ihsaan-ullah
Copy link
Collaborator

ihsaan-ullah commented Aug 24, 2023

Screenshot 2023-08-24 at 2 48 52 PM I also get this empty error on profile img update

@Didayolo
Copy link
Member Author

The error log suggests that there is a unique constraint on the display_name field in the database schema, and the code is attempting to insert or update a record that would cause this constraint to be violated. Specifically, the error suggests that a record with an empty display name (display_name=()) already exists, and another record with an empty display name is being attempted to be saved.

@Didayolo
Copy link
Member Author

I also get this empty error on profile img update

Exactly

@ihsaan-ullah
Copy link
Collaborator

But locally it works. I think cleaning test server is important

@Didayolo
Copy link
Member Author

OK the problem comes from the "display name" that is empty. If you fill this field you can save.

@Didayolo
Copy link
Member Author

Didayolo commented Aug 24, 2023

So I guess it is not related to these PR.

@Didayolo
Copy link
Member Author

I confirm that the behavior is the same on codabench.org. I'll open an issue.

@ihsaan-ullah
Copy link
Collaborator

So I guess it is not related to these PR. It is just that, when you create an account, the display name should be the username by default. Otherwise the not-null constraint will create problems like this one.

yes the PR is not doing anything with saving profile. this can be investigated more in a separate issue

@Didayolo Didayolo merged commit e6389ce into master Aug 24, 2023
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.

4 participants