Mahara: 17.10.0 (during upgrade from 16.10)
OS: Linux 14.04
DB: Postgres
Browser: N/A - running upgrade through CLI
During the upgrade from a Mahara 16.10.6 to Mahara 17.10, we get the following error:
[WAR] 42 (lib/adodb/adodb-exceptions.inc.php:45) Array to string conversion
Call stack (most recent first):
* log_message("Array to string conversion", 8, true, true, "/var/www/mahara/htdocs/lib/adodb/adodb...", 45) at /var/www/mahara/htdocs/lib/errors.php:521
* error(8, "Array to string conversion", "/var/www/mahara/htdocs/lib/adodb/adodb...", 45, array(size 7)) at /var/www/mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:45
* ADODB_Exception->__construct("postgres8", "adodb_throw", -1, "ERROR: null value in column "time" violates not-n...", "INSERT INTO "event_log" ("usr", "realusr", "event"...", array(size 4), object(ADODB_postgres8)) at /var/www/mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:80
* adodb_throw("postgres8", "adodb_throw", -1, "ERROR: null value in column "time" violates not-n...", "INSERT INTO "event_log" ("usr", "realusr", "event"...", array(size 4), object(ADODB_postgres8)) at /var/www/mahara/htdocs/lib/adodb/adodb.inc.php:313
* ADODB_TransMonitor("postgres8", "EXECUTE", -1, "ERROR: null value in column "time" violates not-n...", "INSERT INTO "event_log" ("usr", "realusr", "event"...", array(size 4), object(ADODB_postgres8)) at /var/www/mahara/htdocs/lib/adodb/adodb.inc.php:1264
* ADOConnection->_Execute("INSERT INTO "event_log" ("usr", "realusr", "event"...", array(size 4)) at /var/www/mahara/htdocs/lib/adodb/adodb.inc.php:1224
* ADOConnection->Execute("INSERT INTO "event_log" ("usr", "realusr", "event"...", array(size 4)) at /var/www/mahara/htdocs/lib/dml.php:1102
* insert_record("event_log", object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:2008
* handle_event("saveartefact", object(ArtefactTypeStudentid)) at /var/www/mahara/htdocs/artefact/lib.php:658
* ArtefactType->commit() at /var/www/mahara/htdocs/artefact/internal/lib.php:774
* ArtefactTypeCachedProfileField->commit() at /var/www/mahara/htdocs/lib/user.php:577
* set_profile_field("56999", "studentid", "u3547155", true) at /var/www/mahara/htdocs/lib/db/upgrade.php:4731
* xmldb_core_upgrade("2016090230") at /var/www/mahara/htdocs/lib/upgrade.php:347
* upgrade_core(object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:268
* upgrade_mahara(array(size 1)) at /var/www/mahara/htdocs/admin/cli/upgrade.php:53
[WAR] 42 (lib/errors.php:859) Failed to get a recordset: postgres8 error: [-1: ERROR: null value in column "time" violates not-null constraint
[WAR] 42 (lib/errors.php:859) DETAIL: Failing row contains (0, 0, null, saveartefact, {"owner":"56999","ctime":1511926716,"mtime":1511926716,"atime":1...).] in adodb_throw(INSERT INTO "event_log" ("usr", "realusr", "event", "data") VALUES (?, ?, ?, ?), Array)Command was: INSERT INTO "event_log" ("usr", "realusr", "event", "data") VALUES (?, ?, ?, ?) and values was (usr:0,realusr:0,event:saveartefact,data:{"owner":"56999","ctime":1511926716,"mtime":1511926716,"atime":1511926716,"title":"u3547155","author":"56999","path":"\/314601"})
Call stack (most recent first):
* log_message("Failed to get a recordset: postgres8 error: [-1: E...", 8, true, true) at /var/www/mahara/htdocs/lib/errors.php:95
* log_warn("Failed to get a recordset: postgres8 error: [-1: E...") at /var/www/mahara/htdocs/lib/errors.php:859
* SQLException->__construct("Failed to get a recordset: postgres8 error: [-1: E...") at /var/www/mahara/htdocs/lib/dml.php:1105
* insert_record("event_log", object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:2008
* handle_event("saveartefact", object(ArtefactTypeStudentid)) at /var/www/mahara/htdocs/artefact/lib.php:658
* ArtefactType->commit() at /var/www/mahara/htdocs/artefact/internal/lib.php:774
* ArtefactTypeCachedProfileField->commit() at /var/www/mahara/htdocs/lib/user.php:577
* set_profile_field("56999", "studentid", "u3547155", true) at /var/www/mahara/htdocs/lib/db/upgrade.php:4731
* xmldb_core_upgrade("2016090230") at /var/www/mahara/htdocs/lib/upgrade.php:347
* upgrade_core(object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:268
* upgrade_mahara(array(size 1)) at /var/www/mahara/htdocs/admin/cli/upgrade.php:53
[WAR] 42 (lib/dml.php:1105) Failed to get a recordset: postgres8 error: [-1: ERROR: null value in column "time" violates not-null constraint
[WAR] 42 (lib/dml.php:1105) DETAIL: Failing row contains (0, 0, null, saveartefact, {"owner":"56999","ctime":1511926716,"mtime":1511926716,"atime":1...).] in adodb_throw(INSERT INTO "event_log" ("usr", "realusr", "event", "data") VALUES (?, ?, ?, ?), Array)Command was: INSERT INTO "event_log" ("usr", "realusr", "event", "data") VALUES (?, ?, ?, ?) and values was (usr:0,realusr:0,event:saveartefact,data:{"owner":"56999","ctime":1511926716,"mtime":1511926716,"atime":1511926716,"title":"u3547155","author":"56999","path":"\/314601"})
Call stack (most recent first):
* insert_record("event_log", object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:2008
* handle_event("saveartefact", object(ArtefactTypeStudentid)) at /var/www/mahara/htdocs/artefact/lib.php:658
* ArtefactType->commit() at /var/www/mahara/htdocs/artefact/internal/lib.php:774
* ArtefactTypeCachedProfileField->commit() at /var/www/mahara/htdocs/lib/user.php:577
* set_profile_field("56999", "studentid", "u3547155", true) at /var/www/mahara/htdocs/lib/db/upgrade.php:4731
* xmldb_core_upgrade("2016090230") at /var/www/mahara/htdocs/lib/upgrade.php:347
* upgrade_core(object(stdClass)) at /var/www/mahara/htdocs/lib/mahara.php:268
* upgrade_mahara(array(size 1)) at /var/www/mahara/htdocs/admin/cli/upgrade.php:53
The issue is that there are changes to the table event_log which is not catered for in this part of the script.
Also getting this error further down the upgrade:
[WAR] f3 (lib/db/ upgrade. php:5228) Undefined property: stdClass::$id "Undefined property: stdClass::$id", 8, true, true, "/var/www/ mahara/ htdocs/ lib/db/ upgrade. ...", 5228) at /var/www/ mahara/ htdocs/ lib/errors. php:521 mahara/ htdocs/ lib/db/ upgrade. ...", 5228, array(size 37)) at /var/www/ mahara/ htdocs/ lib/db/ upgrade. php:5228 upgrade( "2016090230" ) at /var/www/ mahara/ htdocs/ lib/upgrade. php:347 core(object( stdClass) ) at /var/www/ mahara/ htdocs/ lib/mahara. php:268 mahara( array(size 1)) at /var/www/ mahara/ htdocs/ admin/cli/ upgrade. php:53
Call stack (most recent first):
* log_message(
* error(8, "Undefined property: stdClass::$id", "/var/www/
* xmldb_core_
* upgrade_
* upgrade_
[WAR] f3 (lib/db/ upgrade. php:5229) Undefined property: stdClass: :$artefacttype "Undefined property: stdClass: :$artefacttype" , 8, true, true, "/var/www/ mahara/ htdocs/ lib/db/ upgrade. ...", 5229) at /var/www/ mahara/ htdocs/ lib/errors. php:521 :$artefacttype" , "/var/www/ mahara/ htdocs/ lib/db/ upgrade. ...", 5229, array(size 37)) at /var/www/ mahara/ htdocs/ lib/db/ upgrade. php:5229 upgrade( "2016090230" ) at /var/www/ mahara/ htdocs/ lib/upgrade. php:347 core(object( stdClass) ) at /var/www/ mahara/ htdocs/ lib/mahara. php:268 mahara( array(size 1)) at /var/www/ mahara/ htdocs/ admin/cli/ upgrade. php:53
Call stack (most recent first):
* log_message(
* error(8, "Undefined property: stdClass:
* xmldb_core_
* upgrade_
* upgrade_
Related to the event_log table changes.