Error reading from database Moodle 2.3.1

Error reading from database Moodle 2.3.1

by Tracey Collins -
Number of replies: 11

Hi,

I am running Moodle 2.3.1 (Build: 20120726) and have received the following error when trying to restore a course from a backup.

When I click on the More information link, I get the following message:

I have purged all caches and the problem has persisted.

I have been able to successfully restore another backup file in the same install of Moodle. The backup file that is causing the problem has also been used successfully on a number of previous occassions.

 

The same error message also appears if I select Site Administration/Registration:

Does anyone know why this error is appearing and what I can do to overcome it?

Thanks,

Tracey

Average of ratings: -
In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by Ken Task -
Picture of Particularly helpful Moodlers

By chance, are you restoring and changing course name/details in order to replicate?

At what point in the restore process does this happen?

Might turn on debug.

'spirit of sharing', Ken

In reply to Ken Task

Re: Error reading from database Moodle 2.3.1

by Tracey Collins -

Hi Ken,

Yes, I am changing the course name and details in order to replicate the file (ie we are using it as a template).

I get all the way through the restore process and then the 'error reading from database' message comes up when you would normally see the message saying you have been succesful.

I did turn on debug and our tech person had a look at the messages, but he checked all of the settings etc that were identified and couldn't find any problems in our database setup.

Thanks

Tracey

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by Ken Task -
Picture of Particularly helpful Moodlers

Check the moodle data folder/temp/backup/ for .log files.  Files with 0 bytes means successful backup/restores.  Dot log files greater than 0 bytes might give hints as to issue.  Might find a hashed named folder or files also contained therein.  Look through them via 'head' via command line (if you have one of those flavored boxen with the ability).

Example:

head 26054d2fda7ae23656e3ab579691e51d

Safe to remove them manually.

Also check apache error logs.

If the last course replication was successful and one hasn't tweaked it too much already, make a backup of that course and use it as the 'replicator'.

When replicating like this seem to re-call one could begin to have issues if in the course description form one didn't change all values ... course shortname, etc.

'spirit of sharing', Ken

In reply to Ken Task

Re: Error reading from database Moodle 2.3.1

by Tracey Collins -

Hi again,

I have still had no success with restoring my backup and turned on developer level debugging to see if that might help someone to identify the source of the problem. The error I receive now is:

Error writing to database

More information about this error

Debug info: SQLState: 40001<br>
Error Code: 1205<br>
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Transaction (Process ID 57) was deadlocked on lock | generic waitable object resources with another process and has been chosen as the deadlock victim. Rerun the transaction.<br>

UPDATE #mdl_backup_files_temp SET newcontextid = '622',newitemid = '701' WHERE id = '1'
[array (
0 => '622',
1 => '701',
2 => '1',
)]
Error code: dmlwriteexception

Stack trace:

  • line 410 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 258 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
  • line 365 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
  • line 1044 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
  • line 1076 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->update_record_raw()
  • line 933 of \backup\util\dbops\restore_dbops.class.php: call to sqlsrv_native_moodle_database->update_record()
  • line 222 of \backup\util\plan\restore_structure_step.class.php: call to restore_dbops::send_files_to_pool()
  • line 1138 of \backup\moodle2\restore_stepslib.php: call to restore_structure_step->add_related_files()
  • line 359 of \backup\util\plan\restore_structure_step.class.php: call to restore_section_structure_step->after_execute()
  • line 108 of \backup\util\plan\restore_structure_step.class.php: call to restore_structure_step->launch_after_execute_methods()
  • line 153 of \backup\util\plan\base_task.class.php: call to restore_structure_step->execute()
  • line 98 of \backup\moodle2\restore_section_task.class.php: call to base_task->execute()
  • line 163 of \backup\util\plan\base_plan.class.php: call to restore_section_task->execute()
  • line 157 of \backup\util\plan\restore_plan.class.php: call to base_plan->execute()
  • line 315 of \backup\controller\restore_controller.class.php: call to restore_plan->execute()
  • line 147 of \backup\util\ui\restore_ui.class.php: call to restore_controller->execute_plan()
  • line 46 of \backup\restore.php: call to restore_ui->execute()

Output buffer: <div class="notifytiny">Invalid get_string() identifier: 'pluginname' or component 'theme_illawarra'. Perhaps you are missing $string['pluginname'] = ''; in D:\WebApps\Moodle2Staging/theme/illawarra/lang/en/theme_illawarra.php?<ul style="text-align: left"><li>line 6594 of \lib\moodlelib.php: call to debugging()</li><li>line 7218 of \lib\moodlelib.php: call to core_string_manager->get_string()</li><li>line 1280 of \lib\outputlib.php: call to get_string()</li><li>line 853 of \lib\textlib.class.php: call to theme_config->get_theme_name()</li><li>line 7315 of \lib\moodlelib.php: call to collatorlib::asort_objects_by_method()</li><li>line 977 of \backup\util\dbops\restore_dbops.class.php: call to get_list_of_themes()</li><li>line 695 of \backup\moodle2\restore_stepslib.php: call to restore_dbops::create_included_users()</li><li>line 34 of \backup\util\plan\restore_execution_step.class.php: call to restore_create_included_users->define_execution()</li><li>line 153 of \backup\util\plan\base_task.class.php: call to restore_execution_step->execute()</li><li>line 163 of \backup\util\plan\base_plan.class.php: call to base_task->execute()</li><li>line 157 of \backup\util\plan\restore_plan.class.php: call to base_plan->execute()</li><li>line 315 of \backup\controller\restore_controller.class.php: call to restore_plan->execute()</li><li>line 147 of \backup\util\ui\restore_ui.class.php: call to restore_controller->execute_plan()</li><li>line 46 of \backup\restore.php: call to restore_ui->execute()</li></ul></div>

Top of Form

Bottom of Form

 

I have also attached a copy of the backup file in the hope that someone can see if they can restore it correctly in v2.3.1.

Thanks,

Tracey

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Tracy,

My Moodle is 2.3.1 (Build: 20120706) which is older than the version you made the backup with, but it restored anyway without any problems. I am using Moodle on a Centos 6.3 server.

Since your backup did restore for me, I made a backup of it and inlcude it here for you to try and use.

I hope this works for you,

AL

In reply to AL Rachels

Re: Error reading from database Moodle 2.3.1

by Tracey Collins -

Hi Al,

Thanks for testing the backup file for me. I have tried to restore your backup and I have received the same error message.

At least this may help to narrow down the problem - there is no problem with the backup file.

Unfortunately I have run out of ideas of where to look for the cause of this issue...

Thanks for your help,

Tracey

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by Ken Task -
Picture of Particularly helpful Moodlers

Google could be your friend here ... a little sluething found:

http://blog.sqlauthority.com/2007/05/16/sql-server-fix-error-1205-transaction-process-id-was-deadlocked-on-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim-rerun-the-transaction/

Dunno if it would apply to your situation or not as the article dated 2007 but it sure reads like your problem.

Best of luck!

'spirit of sharing', Ken

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by Tracey Collins -

We have managed to resolve our problems now.

It seems the cause of all of our varied problems with restoring courses was the MS-SQL driver for PHP. We have changed to the FREETDS driver and we are now able to restore our courses.

Thanks to everyone for your suggestions.

Tracey

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by awake lanka -
Hi Am using configurable reports plugin in that it is getting only 5001 records where as in database there are 12691 records i want to change the limit value to get all the records am new to moodle i have no idea where to change it. Thanks in Advance. Awake
In reply to awake lanka

Re: Error reading from database Moodle 2.3.1

by awake lanka -

Solved

Go to configurable reports

inside components->sql->reports.class

go to line 25 and change the limit 5000 to your value

In reply to Tracey Collins

Re: Error reading from database Moodle 2.3.1

by David Wilson -

Tracey,

 

Can you list what steps you took to switch from the Microsoft driver to FreeTDS?  I have tried to follow the steps on the wiki but I can't get it to work.  Since it's working for you, I'm hoping that I might have better luck copying what you did. smile

 

Thanks,

David M. Wilson