Discussion (forum process) not visible for single user

Hello,

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.

Thank you
Michael

1 Like

I think this is the problem from mongo DB
You can refer this link

Thank you very much for the reply!

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?

Hi @markman8
Try to do login with admin user.

mongo -u admin -p <your_password> --authenticationDatabase admin

Hello @anjali,

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?

Thank you for your time
Michael

@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.

Hello @antoviaque,

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.

Thank you

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.

Thank you all for your help!

@markman8, you can use step 3 script from this link to take backup of MySQL and mongodb.

Thank you very much @jramnai ! I did not noticed it at the first place.