I am running the platform in a native installation. The process “forum” is running properly, and for a single user I cannot view the Discussion page for a course. Message I get on page is “We are sorry, this module is temporarily unavailable …”. Log file /edx/var/log/lms/edx.log contains the following error mesage from python files:
“CommentClientRequestError: [“Username is already taken”]”
As I remember I have deleted this user (probably via Django) and made an account with the same credentials once more.
This is the only user that has this problem with Discussion page. All the rest work properly.
Is there a workaround for this problem? It seems that something was not properly deleted or created for the user.
I have tried to log in using the passwords I saved once the installation has finished for mongo but seems that $mongo -u cs_comments_service -p does not work. It returns authentication failed.
I am using whatever entry for password I have in the my-password.yml file. Am I doing something wrong?
I’ve managed to log in properly (found the proper .yml archive) and viewed the mongo db entries for db.users (using the find() method) as mentioned in the link you have provided.
The current id of the user that has the problem viewing the Discussion is id:15. Though there are no entries in the db for this id. There is another entry (id:14) with the same user name as that in id:15. That must be the problem.
When I deletted the account the entries in the mongo db cs_comments_service did not go away (id:14) and creating the user once more did not made a new entry as the username was already there. I suppose.
I hesitate deleting enty id:14 though since I do not know how to create a new one with id:15 and since I do make here an assumption not a statement.
Do you think that that might work? And if yes, could you provide me with db statements that would make a new user with id:15?
@markman8 If you delete the user in the comment service, you can get it to be automatically recreated using the command:
$ cd /edx/app/edxapp/edx-platform
$ sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings production reload_forum_users
I would recommend making backups of your databases before performing these operations though. You might also want to avoid deleting users from the Django admin in the future, this isn’t well supported - disabling them instead can be a safer way.
Is there any documentation on openedx for mongo db backup? Searching this forum and the documentation from openedx (readthedocs.io) I could not find something relevant. Do I have to dig in to mongoDB site itself?
I will try the commands you have provided as well as the solution @anjali mentioned to see what happens in the mean time. There are not many users currently on the platform but I will need the backup process if something goes wrong in the future.
Problem Solved! It was easier than what I expected! I just had to delete as @anjali mentioned in her link the one entry that conflicted (as I have assumed) id:14. The current user has the id:15 so after deleting id:14, logging in with that user and went to Discussions those appeared normally without any error.
I went back to mongoDB to check the entries and now the same username with the id:15 appeared in the list.
I would like though to know how I do make a backup of my db’s.
I have the same problem now but the link you mentioned was broken. Can you explain the solution again? I also don’t know how to find the password to login in to MongoDB.
Hello @Hoang_PHAM_HUY. Unfortunately there is one year from that post and I do not remember the details from my actions at that time.
Yet as I remember you have to find that .yml file that was generated during the installation of your platform and use that to find the entry for the MongoDB password. You must have had kept it secure or another copy of it somewhere else I suppose.
From what I read from my previous posts at that time:
I deleted the current user from the admin panel (not MongoDB directly) in order to recreated. Yet recreation did not take place as there were leftovers of it in the MongoDB.
I deleted the entry leftovers using the MongoDB as @anjali mentioned.
Not clear here but I suppose I recreated the user and logged in properly with all the panels working back once more.
Please make the backup process before trying anything of the above as I said there is quite a time now that I did it back then.