Forums | Mahara Community
Support
/
Upgrade Error from 19.04.7 to 19.10.6
15 December 2021, 3:25
Hi!!
Im having this problem when I try to update. Event_log table is there but it seems to be empty. Any idea please?
Thanks in advance!
[INF] 8f (admin/cli/upgrade.php:49) Upgrading Mahara
[INF] 8f (lib/mahara.php:234) Upgrading core
[WAR] 8f (lib/errors.php:859) Failed to get a recordset: mysqli error: [1054: Unknown column 'time' in 'field list'] in EXECUTE("SELECT event, data, time
[WAR] 8f (lib/errors.php:859) FROM "event_log"
[WAR] 8f (lib/errors.php:859) WHERE event = 'createuser'
[WAR] 8f (lib/errors.php:859) AND POSITION(',"password":"",' IN data) = 0
[WAR] 8f (lib/errors.php:859) ")Command was: SELECT event, data, time
[WAR] 8f (lib/errors.php:859) FROM "event_log"
[WAR] 8f (lib/errors.php:859) WHERE event = ?
[WAR] 8f (lib/errors.php:859) AND POSITION(',"password":"",' IN data) = 0
[WAR] 8f (lib/errors.php:859) and values was (0:createuser)
15 December 2021, 10:19
Hi,
Is this happening in the upgrade from 19.04 to 19.10 or are you jumping to the latest version of Mahara?
Thank you
Kristina
16 December 2021, 2:58
Hi!
Im trying to update from mahara 17.04 to 19.10, but I ve tried with version 17.10 and 18.04 and I still have the same problem. Sorry for the title maybe I should have started a new post. I was searching in this forum and I think that maybe I have solve that issue changing time for ctime in that table. After I ve changed this it continues for some more setup steps until it arrives until the "_tag" tables. It seems that they dont exist. I did a lot of things to install this upgrade, like update mysql from 5.5 to 5.7, php5 to php 7.4 and migrated to another machine, is it posible that some of this changes have corrupted the DB?. In the other machine with version 15.10 everything worked perfectly but when I started updating BD errors appeared. I had some error with usr_agreement table and I have deleted that table so it has recreate it and continue dont know if that is ok. I ll let you here the error that I have right now.
Thank you very much for your help!
Kepa
[DBG] ef (lib/db/upgrade.php:966) Move the data from the old *_tag tables
[DBG] ca (lib/dml.php:157) mysqli error: [1146: Table 'mahara.artefact_tag' doesn't exist] in EXECUTE("INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[DBG] ca (lib/dml.php:157) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[DBG] ca (lib/dml.php:157) CASE WHEN x.owner IS NOT NULL THEN 'user'
[DBG] ca (lib/dml.php:157) WHEN x.group IS NOT NULL THEN 'group'
[DBG] ca (lib/dml.php:157) ELSE 'institution'
[DBG] ca (lib/dml.php:157) END AS ownertype,
[DBG] ca (lib/dml.php:157) CASE WHEN x.owner IS NOT NULL THEN x.owner
[DBG] ca (lib/dml.php:157) WHEN x.group IS NOT NULL THEN x.group
[DBG] ca (lib/dml.php:157) ELSE x.institution
[DBG] ca (lib/dml.php:157) END AS ownerid,
[DBG] ca (lib/dml.php:157) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[DBG] ca (lib/dml.php:157) FROM "artefact_tag" xt
[DBG] ca (lib/dml.php:157) JOIN "artefact" x ON x.id = xt.artefact")Command was: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[DBG] ca (lib/dml.php:157) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[DBG] ca (lib/dml.php:157) CASE WHEN x.owner IS NOT NULL THEN 'user'
[DBG] ca (lib/dml.php:157) WHEN x.group IS NOT NULL THEN 'group'
[DBG] ca (lib/dml.php:157) ELSE 'institution'
[DBG] ca (lib/dml.php:157) END AS ownertype,
[DBG] ca (lib/dml.php:157) CASE WHEN x.owner IS NOT NULL THEN x.owner
[DBG] ca (lib/dml.php:157) WHEN x.group IS NOT NULL THEN x.group
[DBG] ca (lib/dml.php:157) ELSE x.institution
[DBG] ca (lib/dml.php:157) END AS ownerid,
[DBG] ca (lib/dml.php:157) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[DBG] ca (lib/dml.php:157) FROM "artefact_tag" xt
[DBG] ca (lib/dml.php:157) JOIN "artefact" x ON x.id = xt.artefact
[WAR] ca (lib/errors.php:858) Could not execute command: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[WAR] ca (lib/errors.php:858) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[WAR] ca (lib/errors.php:858) CASE WHEN x.owner IS NOT NULL THEN 'user'
[WAR] ca (lib/errors.php:858) WHEN x.group IS NOT NULL THEN 'group'
[WAR] ca (lib/errors.php:858) ELSE 'institution'
[WAR] ca (lib/errors.php:858) END AS ownertype,
[WAR] ca (lib/errors.php:858) CASE WHEN x.owner IS NOT NULL THEN x.owner
[WAR] ca (lib/errors.php:858) WHEN x.group IS NOT NULL THEN x.group
[WAR] ca (lib/errors.php:858) ELSE x.institution
[WAR] ca (lib/errors.php:858) END AS ownerid,
[WAR] ca (lib/errors.php:858) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[WAR] ca (lib/errors.php:858) FROM "artefact_tag" xt
[WAR] ca (lib/errors.php:858) JOIN "artefact" x ON x.id = xt.artefact
Call stack (most recent first):
* log_message(string(size 963), integer, true, true) at /var/www/mahara-18.10.6/htdocs/lib/errors.php:95
* log_warn(string(size 963)) at /var/www/mahara-18.10.6/htdocs/lib/errors.php:858
* SQLException->__construct(string(size 963)) at /var/www/mahara-18.10.6/htdocs/lib/dml.php:158
* execute_sql(string(size 936)) at /var/www/mahara-18.10.6/htdocs/lib/db/upgrade.php:982
* xmldb_core_upgrade(string(size 10)) at /var/www/mahara-18.10.6/htdocs/lib/upgrade.php:374
* upgrade_core(object(stdClass)) at /var/www/mahara-18.10.6/htdocs/lib/mahara.php:272
* upgrade_mahara(array(size 1)) at /var/www/mahara-18.10.6/htdocs/admin/cli/upgrade.php:56
[WAR] ca (lib/dml.php:158) Could not execute command: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[WAR] ca (lib/dml.php:158) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[WAR] ca (lib/dml.php:158) CASE WHEN x.owner IS NOT NULL THEN 'user'
[WAR] ca (lib/dml.php:158) WHEN x.group IS NOT NULL THEN 'group'
[WAR] ca (lib/dml.php:158) ELSE 'institution'
[WAR] ca (lib/dml.php:158) END AS ownertype,
[WAR] ca (lib/dml.php:158) CASE WHEN x.owner IS NOT NULL THEN x.owner
[WAR] ca (lib/dml.php:158) WHEN x.group IS NOT NULL THEN x.group
[WAR] ca (lib/dml.php:158) ELSE x.institution
[WAR] ca (lib/dml.php:158) END AS ownerid,
[WAR] ca (lib/dml.php:158) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[WAR] ca (lib/dml.php:158) FROM "artefact_tag" xt
[WAR] ca (lib/dml.php:158) JOIN "artefact" x ON x.id = xt.artefact
Call stack (most recent first):
* execute_sql() at /var/www/mahara-18.10.6/htdocs/lib/db/upgrade.php:982
* xmldb_core_upgrade() at /var/www/mahara-18.10.6/htdocs/lib/upgrade.php:374
* upgrade_core() at /var/www/mahara-18.10.6/htdocs/lib/mahara.php:272
* upgrade_mahara() at /var/www/mahara-18.10.6/htdocs/admin/cli/upgrade.php:56
16 December 2021, 4:12
Hi!
This is my usr_agreement error this is from 17.10 to 18.04.
DBG] 6d (lib/db/upgrade.php:714) Auto accept the privacy agreement for all site admins
[WAR] 6d (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."usr_agreement", CONSTRAINT "usragre_sit_fk" FOREIGN KEY ("sitecontentid") REFERENCES "site_content_version" ("id"))] in EXECUTE("INSERT INTO "usr_agreement" ("usr", "sitecontentid", "ctime", "agreed") VALUES ('1', 0, '2021-12-15 16:09:45', 1)")Command was: INSERT INTO "usr_agreement" ("usr", "sitecontentid", "ctime", "agreed") VALUES (?, ?, ?, ?) and values was (usr:1,sitecontentid:,ctime:2021-12-1516:09:45,agreed:1)
Call stack (most recent first):
* log_message(string(size 544), integer, true, true) at /var/www/mahara-18.04.6/htdocs/lib/errors.php:95
* log_warn(string(size 544)) at /var/www/mahara-18.04.6/htdocs/lib/errors.php:859
* SQLException->__construct(string(size 544)) at /var/www/mahara-18.04.6/htdocs/lib/dml.php:1105
* insert_record(string(size 13), object(stdClass)) at /var/www/mahara-18.04.6/htdocs/lib/user.php:3309
* save_user_reply_to_agreement(string(size 1), false, integer) at /var/www/mahara-18.04.6/htdocs/lib/db/upgrade.php:718
* xmldb_core_upgrade(string(size 10)) at /var/www/mahara-18.04.6/htdocs/lib/upgrade.php:370
* upgrade_core(object(stdClass)) at /var/www/mahara-18.04.6/htdocs/lib/mahara.php:268
* upgrade_mahara(array(size 1)) at /var/www/mahara-18.04.6/htdocs/admin/cli/upgrade.php:56
[WAR] 6d (lib/dml.php:1105) Failed to get a recordset: mysqli error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."usr_agreement", CONSTRAINT "usragre_sit_fk" FOREIGN KEY ("sitecontentid") REFERENCES "site_content_version" ("id"))] in EXECUTE("INSERT INTO "usr_agreement" ("usr", "sitecontentid", "ctime", "agreed") VALUES ('1', 0, '2021-12-15 16:09:45', 1)")Command was: INSERT INTO "usr_agreement" ("usr", "sitecontentid", "ctime", "agreed") VALUES (?, ?, ?, ?) and values was (usr:1,sitecontentid:,ctime:2021-12-1516:09:45,agreed:1)
Call stack (most recent first):
* insert_record() at /var/www/mahara-18.04.6/htdocs/lib/user.php:3309
* save_user_reply_to_agreement() at /var/www/mahara-18.04.6/htdocs/lib/db/upgrade.php:718
* xmldb_core_upgrade() at /var/www/mahara-18.04.6/htdocs/lib/upgrade.php:370
* upgrade_core() at /var/www/mahara-18.04.6/htdocs/lib/mahara.php:268
* upgrade_mahara() at /var/www/mahara-18.04.6/htdocs/admin/cli/upgrade.php:56
Thanks in advance!
17 December 2021, 9:41
Hi Kepa,
The last error looks to be because during the upgrade some info from the 'site_content' database table relating to the privacy statement is moved to 'site_content_version' and then the ID of that entry is used so admins on the site are auto accepted fr that privacy statement.
But the error is showing that they are trying to accept privacy statement '0' (or false) so there looks to be some data missing before the upgrade happens.
Can you try running this SQL command on pre-upgraded DB
SELECT * FROM site_content WHERE name IN('privacy','termsandconditions');
It should return data, and if it doesn't you will need to add in a record for 'privacy' and 'termsandconditions'
Cheers
Robert
12 January 2022, 22:22
Thank you very much for your help!
I could find the problem, there was already an entry in prvacy I deleted it and the upgrade has continue without problems.
In this moment Im trying to upgrade from 18.04 to 19.10 and saddly another error has appeared. The error says "mahara.artefact_tag does not exists" I let you here the complete error that maybe could tell you more than I can.
Thanks in advance for your help!!
[INF] 7c (admin/cli/upgrade.php:70) Upgrading Mahara
[INF] 7c (lib/mahara.php:240) Upgrading core
[DBG] 7c (lib/db/upgrade.php:877) Change the artefactid (integer) in the configdata of the existing plan blocktypes to artefactids (array). This change will allow plan blocktypes to contain more than one plan.
[DBG] 7c (lib/db/upgrade.php:905) Create new "existingcopy" table to map who already has what.
[DBG] 7c (lib/mahara.php:2223) Table existingcopy exists. Create skipped
[DBG] 7c (lib/db/upgrade.php:923) Adding new event type "userchangegrouprole"
[DBG] 7c (lib/db/upgrade.php:931) Add a "tags" field to the institution table
[DBG] 7c (lib/db/upgrade.php:941) Add a "tag" table to migrate all the tag information to
[DBG] 7c (lib/mahara.php:2223) Table tag exists. Create skipped
[DBG] 7c (lib/db/upgrade.php:957) Move the data from the old *_tag tables
[DBG] 7c (lib/dml.php:180) mysqli error: [1146: Table 'mahara.artefact_tag' doesn't exist] in EXECUTE("INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[DBG] 7c (lib/dml.php:180) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[DBG] 7c (lib/dml.php:180) CASE WHEN x.owner IS NOT NULL THEN 'user'
[DBG] 7c (lib/dml.php:180) WHEN x.group IS NOT NULL THEN 'group'
[DBG] 7c (lib/dml.php:180) ELSE 'institution'
[DBG] 7c (lib/dml.php:180) END AS ownertype,
[DBG] 7c (lib/dml.php:180) CASE WHEN x.owner IS NOT NULL THEN x.owner
[DBG] 7c (lib/dml.php:180) WHEN x.group IS NOT NULL THEN x.group
[DBG] 7c (lib/dml.php:180) ELSE x.institution
[DBG] 7c (lib/dml.php:180) END AS ownerid,
[DBG] 7c (lib/dml.php:180) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[DBG] 7c (lib/dml.php:180) FROM "artefact_tag" xt
[DBG] 7c (lib/dml.php:180) JOIN "artefact" x ON x.id = xt.artefact")Command was: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[DBG] 7c (lib/dml.php:180) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[DBG] 7c (lib/dml.php:180) CASE WHEN x.owner IS NOT NULL THEN 'user'
[DBG] 7c (lib/dml.php:180) WHEN x.group IS NOT NULL THEN 'group'
[DBG] 7c (lib/dml.php:180) ELSE 'institution'
[DBG] 7c (lib/dml.php:180) END AS ownertype,
[DBG] 7c (lib/dml.php:180) CASE WHEN x.owner IS NOT NULL THEN x.owner
[DBG] 7c (lib/dml.php:180) WHEN x.group IS NOT NULL THEN x.group
[DBG] 7c (lib/dml.php:180) ELSE x.institution
[DBG] 7c (lib/dml.php:180) END AS ownerid,
[DBG] 7c (lib/dml.php:180) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[DBG] 7c (lib/dml.php:180) FROM "artefact_tag" xt
[DBG] 7c (lib/dml.php:180) JOIN "artefact" x ON x.id = xt.artefact
[WAR] 7c (lib/errors.php:859) Could not execute command: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[WAR] 7c (lib/errors.php:859) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[WAR] 7c (lib/errors.php:859) CASE WHEN x.owner IS NOT NULL THEN 'user'
[WAR] 7c (lib/errors.php:859) WHEN x.group IS NOT NULL THEN 'group'
[WAR] 7c (lib/errors.php:859) ELSE 'institution'
[WAR] 7c (lib/errors.php:859) END AS ownertype,
[WAR] 7c (lib/errors.php:859) CASE WHEN x.owner IS NOT NULL THEN x.owner
[WAR] 7c (lib/errors.php:859) WHEN x.group IS NOT NULL THEN x.group
[WAR] 7c (lib/errors.php:859) ELSE x.institution
[WAR] 7c (lib/errors.php:859) END AS ownerid,
[WAR] 7c (lib/errors.php:859) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[WAR] 7c (lib/errors.php:859) FROM "artefact_tag" xt
[WAR] 7c (lib/errors.php:859) JOIN "artefact" x ON x.id = xt.artefact
Call stack (most recent first):
* log_message(string(size 963), integer, true, true) at /var/www/mahara-19.10.6/htdocs/lib/errors.php:95
* log_warn(string(size 963)) at /var/www/mahara-19.10.6/htdocs/lib/errors.php:859
* SQLException->__construct(string(size 963)) at /var/www/mahara-19.10.6/htdocs/lib/dml.php:181
* execute_sql(string(size 936)) at /var/www/mahara-19.10.6/htdocs/lib/db/upgrade.php:973
* xmldb_core_upgrade(string(size 10)) at /var/www/mahara-19.10.6/htdocs/lib/upgrade.php:376
* upgrade_core(object(stdClass)) at /var/www/mahara-19.10.6/htdocs/lib/mahara.php:274
* upgrade_mahara(array(size 1)) at /var/www/mahara-19.10.6/htdocs/admin/cli/upgrade.php:74
[WAR] 7c (lib/dml.php:181) Could not execute command: INSERT INTO "tag" (tag,resourcetype,resourceid,ownertype,ownerid,editedby,ctime,mtime)
[WAR] 7c (lib/dml.php:181) SELECT xt.tag, 'artefact' AS resourcetype, xt.artefact AS resourceid,
[WAR] 7c (lib/dml.php:181) CASE WHEN x.owner IS NOT NULL THEN 'user'
[WAR] 7c (lib/dml.php:181) WHEN x.group IS NOT NULL THEN 'group'
[WAR] 7c (lib/dml.php:181) ELSE 'institution'
[WAR] 7c (lib/dml.php:181) END AS ownertype,
[WAR] 7c (lib/dml.php:181) CASE WHEN x.owner IS NOT NULL THEN x.owner
[WAR] 7c (lib/dml.php:181) WHEN x.group IS NOT NULL THEN x.group
[WAR] 7c (lib/dml.php:181) ELSE x.institution
[WAR] 7c (lib/dml.php:181) END AS ownerid,
[WAR] 7c (lib/dml.php:181) NULL AS editedby, x.ctime AS ctime, x.mtime AS mtime
[WAR] 7c (lib/dml.php:181) FROM "artefact_tag" xt
[WAR] 7c (lib/dml.php:181) JOIN "artefact" x ON x.id = xt.artefact
Call stack (most recent first):
* execute_sql() at /var/www/mahara-19.10.6/htdocs/lib/db/upgrade.php:973
* xmldb_core_upgrade() at /var/www/mahara-19.10.6/htdocs/lib/upgrade.php:376
* upgrade_core() at /var/www/mahara-19.10.6/htdocs/lib/mahara.php:274
* upgrade_mahara() at /var/www/mahara-19.10.6/htdocs/admin/cli/upgrade.php:74
18 January 2022, 13:23
Hi,
It looks like your site has partially upgraded at some point and then when it tries to upgrade again it fails as it tries to access tables that are not existing anymore.
What you can do is check that there is a 'tag' table in your database and that it is populated with data and the following tables do not exist: artefact_tag, collection_tag, usr_tag, view_tag. If so, you can probably get away with commenting out the code in htdocs/lib/db/upgrade.php where things are failing, lines 941 - 989.
Let me know if that helps
Cheers
Robert
- «Previous page
- 1
- 2
- »Next page