Error Writing to Database

Error Writing to Database

by Matthew Chermside -
Number of replies: 5

Moodle 2.2.3,

Ubuntu Server 12.04

PHP 5.3.10

Out of nowhere I have started getting this dreaded error message "error writing to database" and we cannot create courses ANYWHERE on the site.

From what I understand in other posts this is a sorting issue on the mdl_course table?

Any advice anybody? This is practically breacking our site!

Best regards

Matt

Average of ratings: -
In reply to Matthew Chermside

Re: Error Writing to Database

by Matthew Chermside -

The only way I can add a new course anywhere on the site now is to do it in the DB in phpmyadmin and then edit the course settings for the new course in MOODLE - saving the settings then creates a new course.

Is MOODLE 2.3 broken?

In reply to Matthew Chermside

Re: Error Writing to Database

by Akinsaya Delamarre -

Hello Matthew,

What version of Moodle 2.3 are you using?

Also turn in developer debugging, then try to add a course and see what error message gets returned.  Thay may shed some light on what the issue is.

Regards, 

Average of ratings: Useful (1)
In reply to Akinsaya Delamarre

Re: Error Writing to Database

by Matthew Chermside -

Thanks for your reply. We use MOODLE 2.2.3.

Had already turned on debugging and got no error message other than the 'error writing to database'.

One other way that succeeds in creating courses is to take a backup of an existing course and restore it as as new course - a bit messy but it works. It does however throw up the following debugging error:

Error: mdb->get_record() found more than one record!

  • line 1309 of /lib/dml/moodle_database.php: call to debugging()
  • line 1269 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
  • line 1285 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_record_select()
  • line 1113 of /backup/moodle2/restore_stepslib.php: call to restore_dbops::calculate_course_names()
  • line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_course_structure_step->process_course()
  • line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
  • line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
  • line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
  • line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
  • line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
  • line 212 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
  • line ? of unknownfile: call to progressive_parser->start_tag()
  • line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
  • line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
  • line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
  • line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
  • line 148 of /backup/util/plan/base_plan.class.php: call to base_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()


    Very weird  - I really need to get this fixed so my teachers can create courses without me needing to resort to methods like this!

Best regards

Matt

In reply to Akinsaya Delamarre

Re: Error Writing to Database

by Matthew Chermside -

Now I get the following Debug info shown in the screenshot.

Attachment Untitled-1.png
In reply to Matthew Chermside

Re: Error Writing to Database

by Matthew Chermside -

Have resolved this myself by editing the php.ini file. I had the global upload limit set to 2Gb because of some large courses that were restored from a MOODLE 1.9 Migration. Everything had worked fine for a while but for some reason this became a problem for the syste. Set the global upload to 1gb and all is well on the site and people can create courses again. Never thought it would be that simple.

Average of ratings: Useful (1)