adding new user - Error reading from database

adding new user - Error reading from database

by Adolf Goreseb -
Number of replies: 11

Hi, 

I would like to add new user manually, but whenever I add a new user I am getting an error message reading as follows: Error reading from database

Here is the screenshots. 

Add new user.


config.php file. 


database server collation


Assistance will be of highest value. 

Thanks, 

Adolf

Average of ratings: -
In reply to Adolf Goreseb

Re: adding new user - Error reading from database

by Ken Task -
Picture of Particularly helpful Moodlers

Turn on debugging.  Try to add a user again.  Let's see what moodle might be saying about the issue/error.

'SoS', Ken

In reply to Ken Task

Re: adding new user - Error reading from database

by Adolf Goreseb -
I turned on the debugging, but under logs I don't see any error relating to adding a user.

Adolf
In reply to Adolf Goreseb

Re: adding new user - Error reading from database

by Ken Task -
Picture of Particularly helpful Moodlers

Debugging to developer level and set to display, if there are any errors, they should display to your screen where you could copy the text of the error reported or take a screen shot.

Your server should also be keeping error logs (not displayed in Moodle) ... those are accessed via what ever access you have to server ... cPanel/SSH.

When you add a user and the error appears, where does the 'more info' link take you?  (url please).

And, assume you are logged on a an admin level user and not lower level.

'SoS', Ken

In reply to Adolf Goreseb

Re: adding new user - Error reading from database

by Saaid Agherdien -
Hi
I recently experienced a similar problem "could not add a new user", but this was post an upgrade from moodle 3.1 to 3.5. The database ended up with two "collations" utf8 and utf8mb4. After fixing the database to have the same collation: utf8mb4_unicode_ci, the problem resolved. I could then add new users.
Average of ratings: Useful (2)
In reply to Saaid Agherdien

Re: adding new user - Error reading from database

by Welmoed Geekie -
Hi Saaid
I receive the same error message when trying to add a new user since I updated to Moodle 3.10.

Please can you help me to do what you did:" fix the database to have the same collation: utfmb4_unicode_ci"?
I don't have any experience with databases.
I assume I need to access the database from my cpanel or is this done within Moodle?

I am on working on Academi, Moodle version 3.10.

This is the more info I get at the MORE INFO link in the error message:
error/moodle/dmlreadexception
This message was displayed because Moodle experienced a problem trying to read data from your Moodle database.
To get more information about the error you should enable Debugging in Settings > Site administration > Development > Debugging.
Setting this debugging mode will cause Moodle to display detailed information about the problem and a stack trace. You can then use this information and try searching moodle.org and the Moodle Tracker to find any other reports of the problem with suggested solutions, or if necessary create a new issue for it in the Tracker. The Moodle developers will then use this information to reproduce and debug the problem.
After you have reported the problem reset the debugging level to the original state so that your users do not see the debugging messages.

I look forward to hearing from you.
In reply to Welmoed Geekie

Re: adding new user - Error reading from database

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

In the steps you've posted it suggests enabling debugging: Under Site administration ▸ Development ▸ Debugging set Debug messages to 'DEVELOPER' and Display debug messages to Yes:

Screenshot showing 'debug': DEVELOPER and 'debugdisplay': Yes.

This should show more details when the error appears. If you share these details we will try help.

In reply to Leon Stringer

Re: adding new user - Error reading from database

by Welmoed Geekie -
Hi Leon. Thank you for your fast response.
After following your instructions: this is what displays:
parent does not exist!
line 920 of /lib/adminlib.php: call to debugging()
line 68 of /admin/settings/privacy.php: call to admin_category->add()
line 8762 of /lib/adminlib.php: call to require()
line 8892 of /lib/adminlib.php: call to admin_get_root()
line 44 of /admin/settings.php: call to admin_write_settings()
parent does not exist!
line 920 of /lib/adminlib.php: call to debugging()
line 79 of /admin/settings/privacy.php: call to admin_category->add()
line 8762 of /lib/adminlib.php: call to require()
line 8892 of /lib/adminlib.php: call to admin_get_root()
line 44 of /admin/settings.php: call to admin_write_settings()


line 28 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtphosts' or component 'message_email'. Perhaps you are missing $string['configsmtphosts'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 28 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'none' or component 'message_email'. Perhaps you are missing $string['none'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 29 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'smtpsecure' or component 'message_email'. Perhaps you are missing $string['smtpsecure'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 30 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtpsecure' or component 'message_email'. Perhaps you are missing $string['configsmtpsecure'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 30 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'smtpauthtype' or component 'message_email'. Perhaps you are missing $string['smtpauthtype'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 32 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtpauthtype' or component 'message_email'. Perhaps you are missing $string['configsmtpauthtype'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 32 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'smtpuser' or component 'message_email'. Perhaps you are missing $string['smtpuser'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 33 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtpuser' or component 'message_email'. Perhaps you are missing $string['configsmtpuser'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 33 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'smtppass' or component 'message_email'. Perhaps you are missing $string['smtppass'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 34 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtpuser' or component 'message_email'. Perhaps you are missing $string['configsmtpuser'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 34 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'smtpmaxbulk' or component 'message_email'. Perhaps you are missing $string['smtpmaxbulk'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 35 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsmtpmaxbulk' or component 'message_email'. Perhaps you are missing $string['configsmtpmaxbulk'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 35 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'noreplyaddress' or component 'message_email'. Perhaps you are missing $string['noreplyaddress'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 36 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'confignoreplyaddress' or component 'message_email'. Perhaps you are missing $string['confignoreplyaddress'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 37 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configemailonlyfromnoreplyaddress' or component 'message_email'. Perhaps you are missing $string['configemailonlyfromnoreplyaddress'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 40 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'sitemailcharset' or component 'message_email'. Perhaps you are missing $string['sitemailcharset'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 47 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configsitemailcharset' or component 'message_email'. Perhaps you are missing $string['configsitemailcharset'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 47 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'allowusermailcharset' or component 'message_email'. Perhaps you are missing $string['allowusermailcharset'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 48 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configallowusermailcharset' or component 'message_email'. Perhaps you are missing $string['configallowusermailcharset'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 48 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'allowattachments' or component 'message_email'. Perhaps you are missing $string['allowattachments'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 49 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configallowattachments' or component 'message_email'. Perhaps you are missing $string['configallowattachments'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 49 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'mailnewline' or component 'message_email'. Perhaps you are missing $string['mailnewline'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 51 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Invalid get_string() identifier: 'configmailnewline' or component 'message_email'. Perhaps you are missing $string['configmailnewline'] = ''; in /home/expertrep/public_html/message/output/email/lang/en/message_email.php?
line 353 of /lib/classes/string_manager_standard.php: call to debugging()
line 7435 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 51 of /message/output/email/settings.php: call to get_string()
line 68 of /lib/classes/plugininfo/message.php: call to include()
line 76 of /admin/settings/messaging.php: call to core\plugininfo\message->load_settings()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
parent does not exist!
line 920 of /lib/adminlib.php: call to debugging()
line 68 of /admin/settings/privacy.php: call to admin_category->add()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
parent does not exist!
line 920 of /lib/adminlib.php: call to debugging()
line 79 of /admin/settings/privacy.php: call to admin_category->add()
line 8762 of /lib/adminlib.php: call to require()
line 19 of /admin/settings.php: call to admin_get_root()
Capability "moodle/community:add" was not found! This has to be fixed in code.
line 453 of /lib/accesslib.php: call to debugging()
line 34 of /blocks/community/block_community.php: call to has_capability()
line 228 of /lib/blocklib.php: call to block_community->user_can_addto()
line 4069 of /lib/navigationlib.php: call to block_manager->get_addable_blocks()
line 781 of /lib/pagelib.php: call to flat_navigation->initialise()
line 830 of /lib/pagelib.php: call to moodle_page->magic_get_flatnav()
line 150 of /theme/academi/layout/columns2.php: call to moodle_page->__get()
line 1374 of /lib/outputrenderers.php: call to include()
line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 121 of /admin/settings.php: call to core_renderer->header()
In reply to Welmoed Geekie

Re: adding new user - Error reading from database

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Unfortunately that long error doesn't show anything about the database dmlreadexception because the site has another problem: files which shouldn't be there. In the upgrade instructions it says "Do NOT copy new files over the old files" but it looks like this has been done on your site. From the long error it looks like:

  1. The Community Finder block (block_community) is present which was removed in Moodle 3.7.2.
  2. The file message/output/email/settings.php is present which was removed in Moodle 3.2.

See here about removing the Community Finder block, and you can probably just delete message/output/email/settings.php from the Moodle source code folder. But if these old files are there then there may be others so it would be best to ensure that only Moodle 3.10 files are present by doing the following:

  1. Move the files and folders in the Moodle source code folder (the site's home directory) into a backup folder.
  2. Download and extract the Moodle 3.10 files into the source code folder.
  3. Copy config.php from the backup folder into the Moodle source code folder along with any additional plugins or themes you have.

Regarding the original database error, the dbcollation Moodle uses is set in config.php which is a file in the Moodle source code folder which you can probably access this using File Manager in cPanel. dbcollation should normally be either utf8mb4_unicode_ci or utf8_unicode_ci, what does yours say?

Sorry this is more complicated than I'm sure you would like. If you need any help beyond the original database error, post a new discussion topic in the forum and we'll try to help.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: adding new user - Error reading from database

by Welmoed Geekie -
Thank you very much. I will look into this and see what I can achieve.
In reply to Welmoed Geekie

Re: adding new user - Error reading from database

by Welmoed Geekie -
I need some time, as I am unfamiliar with databases.

Your question: " Regarding the original database error, the dbcollation Moodle uses is set in config.php which is a file in the Moodle source code folder which you can probably access this using File Manager in cPanel. dbcollation should normally be either utf8mb4_unicode_ci or utf8_unicode_ci, what does yours say?"

When I go the File Manager in cpanel, I can't find anything related to config.php.
When I go to PhpMyAdmin under General Settings it states utf8mb4_unicode_ci.
In reply to Welmoed Geekie

Re: adding new user - Error reading from database

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

From your phpMyAdmin, I would expect that dbcollation should be 'utf8mb4_unicode_ci' in config.php.

config.php is a file in the root (top-level) of the Moodle source code folder, this folder is where your web server serves your Moodle site from (also known as the site home or document root). It's where the Moodle source code was placed when installing and upgrading the site. If you see any folders in File Manager have a look inside, see this reply for examples of the files and folders that you're looking for. If you're still not getting anywhere, share a screenshot of the File Manager and we'll try to guide you.