Moodle 2.0preview2: Error writing to database

Moodle 2.0preview2: Error writing to database

by Markus Strobl -
Number of replies: 14

Hello,

I'm testing Moodle 2.0 to implement it with the new school year in september.

I copied the whole mooedledata-folder and the whole database to a new server. Starting moodle was followed by several installation-dialogues. And after the plugin-check I always get the same error message:

Error writing to database

Anybody an idea, since the mySql-user surely can write into the database (for example using phpmyadmin). The mysql-server is not the localhost!

Attached you can see screenshot

Attachment moodle_installation_error.jpg
Average of ratings: -
In reply to Markus Strobl

Re: Moodle 2.0preview2: Error writing to database

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Markus,

Thanks for your help testing Moodle 2.0. Unfortunately I don't have any ideas about your error, however I'm going to move your discussion to the testing and QA forum where hopefully someone will have an answer...
In reply to Helen Foster

Re: Moodle 2.0preview2: Error writing to database

by Markus Strobl -

Thx Helen

 

I testet it once again on my laptop using the mobile Webserver "MoWeS Portable" as a web-service-platform. (http://www.chsoftware.net/en/mowes/mowesportable/mowes.htm)

Afterwards I copied moodledata and moodle-database to the new local webserver.

Installing Moodle2 finished with the same error - so it is not a problem of my official webserver, since the problem can be rebuild in an testing-environment.

attached a screenshot

Attachment moodle_installation_error2.jpg
In reply to Markus Strobl

Re: Moodle 2.0preview2: Error writing to database

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Markus,

Can you please try again, this time make sure you have:

  • the latest development version from the download page or CVS
  • this in your config.php file:

    $CFG->debug = 38911; $CFG->debugdisplay = true;

You should see more information in the crash - please post it here.

Average of ratings: Useful (2)
In reply to Martin Dougiamas

Re: Moodle 2.0preview2: Error writing to database

by Markus Strobl -

Hello Martin,

I downloaded and extracted the latest ZIP-file

Attached the debug-information

Attachment moodle_installation_error3.jpg
In reply to Markus Strobl

Re: Moodle 2.0preview2: Error writing to database

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Markus,

if I'm not wrong some similar problem was reported and fixed some days ago (see MDL-22503). I've reopened it and attached one prospective patch to have this fixed. Just awaiting for some feedback from other devs before pushing it to 2.0.

If you are able to test the patch (MDL-22503b.patch.txt) in your server... any feedback will be welcome in the bug above.

TIA and ciao smile
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Moodle 2.0preview2: Error writing to database

by Markus Strobl -

Hello

Since I'm not using the CVS-version but the normal download I don't know how to use the patch to make a test for you.

Or is it better to wait for the implementation of the patch in the daily-build of the download section and try the upgrade afterwards again?

In reply to Eloy Lafuente (stronk7)

Re: Moodle 2.0preview2: Error writing to database

by Markus Strobl -

Made a manual change to upgrade.php as described in MDL-22503b.patch.txt.

Problem seems to be solved, upgrade of my test-version from 1.9 to 2.0 was successfull!

In reply to Eloy Lafuente (stronk7)

Re: Moodle 2.0preview2: Error writing to database

by Roman Hurtik -

I'm having the same problem. The update froze with “Error writing to database” when trying to upgrade from Moodle 1.9.10 to Moodle 2.0 (weekly release 26 of dec 2010). The patch from => http://tracker.moodle.org/browse/MDL-22503 is from the may 2010 and is not working. I've tried to manually applied changes, all I get is error :

Parse error: syntax error, unexpected $end in /path to moodle/lib/db/upgrade.php on line 5522 “

In reply to Eloy Lafuente (stronk7)

Error writing to database

by Faramarz Kazemainy -

Hi. Sorry I get the same error; then I activated debuginng and got the following information:

Error writing to database

More information about this error

Debug info: INSERT command denied to user 'autec'@'192.168.110.107' for table 'mdl_config_plugins' INSERT INTO mdl_config_plugins (plugin,name,value) VALUES(?,?,?) [array (   0 => 'admin',   1 => 'lastloginserterrormail',   2 => 1330981549, )]
Stack trace:
  • line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 893 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 935 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 1254 of \lib\moodlelib.php: call to mysqli_native_moodle_database->insert_record()
  • line 1728 of \lib\datalib.php: call to set_config()
  • line 177 of \login\index.php: call to add_to_log()
Output buffer: <div class="notifytiny">Error: Could not insert a new entry to the Moodle log<ul style="text-align: left"><li>line 1714 of \lib\datalib.php: call to debugging()</li><li>line 177 of \login\index.php: call to add_to_log()</li></ul></div> Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in E:\web\hescooco\EC\lib\datalib.php on line 1727
Would you please let me know what I should do?
My site is:
Kindest regards
In reply to Martin Dougiamas

Re: Moodle 2.0preview2: Error writing to database

by Paul Vaughan -
$CFG->debug = 38911;

Thanks for this Martin. I had $CFG->debug set to 2047 and wasn't getting the full stack trace.

In reply to Paul Vaughan

Re: Moodle 2.0preview2: Error writing to database

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
See the section 8 of config-dist.php - it contains various development and debugging related settings you may find useful during testing.
Average of ratings: Useful (1)
In reply to Martin Dougiamas

Re: Moodle 2.0preview2: Error writing to database

by Mauricio Salles -
Hi Martin, I get the "error writing to database" when trying to customize my language (portuguese). When trying to customize english terms, the system works properly. I've put the code into config.php file and got the following results: Debug info: Incorrect string value: '\xC5\x95io s...' for column 'master' at row 1 INSERT INTO mdl_report_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES(?,?,?,?,?,?,?,?,?) [array ( 0 => 'pt_br', 1 => '29', 2 => 'feedback_help', 3 => 'This box enables any comments about the grade to be added.', 4 => '

Comentários adicionados à nota pelo professor. Eles podem ser gerais, personalizados ou um comentaŕio simples referente a um sistema interno de feedback.

', 5 => 1300481786, 6 => 0, 7 => NULL, 8 => NULL, )] Stack trace: line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown line 874 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 916 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 174 of /admin/report/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record() line 48 of /admin/report/customlang/index.php: call to report_customlang_utils::checkout() Could you please help me? What should I do? regards
In reply to Mauricio Salles

Re: Moodle 2.0preview2: Error writing to database

by Tayyab Cheema -

Hello,

          I am also trying to install moodle 2.2.1 with mysql & oracle database but on both databases I am getting the same error "error writing to database" please help me out if any one knows about it...

 

Regards,

Tayyab Cheema