Active users not appearing in the User Table

Active users not appearing in the User Table

by Colin Thorbinson -
Number of replies: 3

Hi,

I hope that this question is in the correct directory.

I have a Moodle instance that has around 3100 active users but when I navigate to the correct user table on the database I can only see around 1700 of them.

This is confusing me as I have setup 7 users who have not received their registration emails, I can see that the cron script has ran successfully but their details have not been entered into the database table 'user'.

After this I have ran a query on the table looking for users with the first name Colin, the query returns 3 values but there are actually 10 users that should be returned.

Is there a particular reason for this, or where are the user details actually being stored?

Any help would be greatly appreciated.

Thanks,

Colin


Average of ratings: -
In reply to Colin Thorbinson

Re: Active users not appearing in the User Table

by Randy Thornton -
Picture of Documentation writers

Sounds like something is not right: are you sure you are looking at the same database both times?

I'd check the db name in the config.php to be sure. And also make sure that the database user name is correct and has the proper privileges in the db as it should.

Consider adding the Adminer plugin to check the database from inside Moodle as the moodle database user.

As a sanity check, on the database run the query

SELECT COUNT(id) from mdl_user WHERE deleted = 0;
it should return exactly one more  (because it includes 'guest')  than the number of active users you see in at the top of the Browse list of users page.

When you manually create a user or upload them, it should immediately add them to the database. It doesn't wait for the email to go out or the user to be confirmed or anything.

In reply to Randy Thornton

Re: Active users not appearing in the User Table

by Colin Thorbinson -

Hi Randy,

Thank you for your quick response.

This is a bit worrying, I've ran your query and once again Moodle shows that I have 3182 users while the SQL Query you provided only returns 1048.

I've scheduled some time where I will be able to look at the Moodle paths with the possibility of incorrect database permissions or paths. It just seems strange how some users appear in the user table where others do not.

Do you have any further suggestions if the paths and permissions are correct?

Thanks!

In reply to Colin Thorbinson

Re: Active users not appearing in the User Table

by Randy Thornton -
Picture of Documentation writers
If paths, users, and privileges all turn out good, and the sql service has been restarted, the next thing I would look at would be indexing, and reindexing the tables.