Fixing Unable to Delete Account Open edX via User Profile
When I test to delete my account from the user profile page, I get the following message after entering the password.
When check the file /edx/var/log/lms/edx.log
i find this.
openedx.core.djangoapps.user_authn.exceptions.AuthFailedError
Oct 25 13:08:55 ubuntu [service_variant=lms][openedx.core.djangoapps.user_api.accounts.views][env:sandbox] ERROR [ubuntu 10792] [user 14] [views.py:472] - 500 error deactivating account Default state does not exist! Populate retirement states to retire users.
Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/models.py", line 320, in create_retirement
pending = RetirementState.objects.all().order_by('state_execution_order')[0]
File "/edx/app/edxapp/venvs/edxapp/lib/python3.5/site-packages/django/db/models/query.py", line 309, in __getitem__
return qs._result_cache[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/accounts/views.py", line 423, in post
UserRetirementStatus.create_retirement(request.user)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/models.py", line 322, in create_retirement
raise RetirementStateError('Default state does not exist! Populate retirement states to retire users.')
openedx.core.djangoapps.user_api.models.RetirementStateError: Default state does not exist! Populate retirement states to retire users.
Oct 25 13:08:55 ubuntu [service_variant=lms][django.request][env:sandbox] ERROR [ubuntu 10792] [user None] [log.py:228] - Internal Server Error: /api/user/v1/accounts/deactivate_logout/
How to fix it?
populate the states table with the following command.
sudo -H -u edxapp bash
source /edx/app/edxapp/edxapp_env
cd /edx/app/edxapp/edx-platform
./manage.py lms --settings=production populate_retirement_states
Tested
- release juniper.master