Assignment Creation - Error writing to database error

Assignment Creation - Error writing to database error

by Jayden Tyronian -
Number of replies: 4

Hi all


I am trying to set up an assignment but any combination of setting choices all lead me to the same end result of a 'Error writing to database'


We are on 3.6.3+ and are on a hosted domain


The debug information is below.  Hoping someone can provide some insight.  I did ready the details in the link which talks about max_allowed_packets.  However being on a hosted server i'm not sure I can do much, so thought I'd see what the community said in case it was something else triggering it that I may be able to fix.

Jayden


Error writing to database

More information about this error

×Debug info: Field 'id' doesn't have a default value
INSERT INTO mdl_assign_plugin_config (assignment,subtype,plugin,name,value) VALUES(?,?,?,?,?)
[array (
0 => '11',
1 => 'assignsubmission',
2 => 'onlinetext',
3 => 'enabled',
4 => 0,
)]
Error code: dmlwriteexception

×Stack trace:

·         line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown

·         line 1329 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

·         line 1375 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()

·         line 341 of /mod/assign/assignmentplugin.php: call to mysqli_native_moodle_database->insert_record()

·         line 220 of /mod/assign/assignmentplugin.php: call to assign_plugin->set_config()

·         line 1208 of /mod/assign/locallib.php: call to assign_plugin->disable()

·         line 693 of /mod/assign/locallib.php: call to assign->update_plugin_instance()

·         line 41 of /mod/assign/lib.php: call to assign->add_instance()

·         line 124 of /course/modlib.php: call to assign_add_instance()

·         line 154 of /course/modedit.php: call to add_moduleinfo()


Average of ratings: -
In reply to Jayden Tyronian

Re: Assignment Creation - Error writing to database error

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That looks like a problem with your particular Moodle install. In Moodle, an id column of a database table will always have a default. Something must have gone wrong when this Moodle site was installed or upgraded.

In reply to Tim Hunt

Re: Assignment Creation - Error writing to database error

by Jayden Tyronian -

Hi Tim


Thanks for replying.  Okay I was starting to think that this may be the case myself.


So the history of this setup was it was installed on an older version 3.1 I think on a different webhost.  It was upgraded to 3.6.3+ then the whole thing moved to a completely different webhost.  The install on the new webhost also 3.6.3+ was a fresh install.


Unfortunately I really can't recall if assignments worked on the old webhost.


How can I resolve this?  Reinstalling may be problematic.  Can I (assuming a column is not correctly defaulted) go into the database find the location in question and default the correct column to fix the issue that way?  if so what exactally am I looking for?  Unfortunately on the new webhost I rely on someone else to do the work in the database (where as I had that access on the old webhost).  It's a long story and a very long vent on my end to go into the details. 


Thanks heaps


Jayden

In reply to Jayden Tyronian

Re: Assignment Creation - Error writing to database error

by Ken Task -
Picture of Particularly helpful Moodlers

Can you do an sql dump of the  DB on new hosting?

If so, how about doing that then import that dump on a server where you do have direct access to server and DB, work on it there and fix.

That assumes you can import an sql dump on new server. sad

'spirit of sharing', Ken



Average of ratings: Useful (1)
In reply to Jayden Tyronian

Re: Assignment Creation - Error writing to database error

by Adam Barbary -
Just checking, the last time we had this issue was a disk space error on the webserver. Simple check, if it's not, move along.


Cheers,

Adam