lti error when upgrading from 19.04 to 20.04

Bug #1892660 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
19.04
Fix Released
High
Unassigned
19.10
Fix Released
High
Unassigned
20.04
Fix Released
High
Unassigned

Bug Description

If we're upgrading from an 19.04 install to a 20.04 version, there will be an error message in the upgrade page like the one copied below.

This happens because we forgot to bump the lti plugin version number in the patch for the following bug
https://bugs.launchpad.net/mahara/+bug/1795597

As a result, any site upgrade that tries to also upgrade the lti plugin will try to run the postintall from the previous patch a second time, getting the error messages.

Error messages during site upgrade:

[DBG] 1b (module/lti/lib.php:30) Add indexes to lti_assessment table
[DBG] 1b (lib/dml.php:180) mysqli error: [1061: Duplicate key name 'mh2_ltiasse_res_ix'] in EXECUTE("CREATE INDEX mh2_ltiasse_res_ix ON mh2_lti_assessment (resourcelinkid(255))")Command was: CREATE INDEX mh2_ltiasse_res_ix ON mh2_lti_assessment (resourcelinkid(255))
[WAR] 1b (lib/errors.php:859) Could not execute command: CREATE INDEX mh2_ltiasse_res_ix ON mh2_lti_assessment (resourcelinkid(255))
Call stack (most recent first):

    log_message("Could not execute command: CREATE INDEX mh2_ltiass...", 8, true, true) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:95
    log_warn("Could not execute command: CREATE INDEX mh2_ltiass...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:859
    SQLException->__construct("Could not execute command: CREATE INDEX mh2_ltiass...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/dml.php:181
    execute_sql("CREATE INDEX mh2_ltiasse_res_ix ON mh2_lti_assessm...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/dml.php:1661
    execute_sql_arr(array(size 1), true, true) at /home/ceciliavg/maharacode/mahara/htdocs/lib/ddl.php:1331
    add_index(object(XMLDBTable), object(XMLDBIndex)) at /home/ceciliavg/maharacode/mahara/htdocs/module/lti/lib.php:37
    PluginModuleLti::postinst("2018071009") at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:1818
    call_static_method("PluginModuleLti", "postinst", "2018071009") at /home/ceciliavg/maharacode/mahara/htdocs/lib/upgrade.php:621
    upgrade_plugin(object(stdClass)) at /home/ceciliavg/maharacode/mahara/htdocs/admin/upgrade.json.php:84

[DBG] 1b (lib/dml.php:180) mysqli error: [1061: Duplicate key name 'mh2_ltiasse_con_ix'] in EXECUTE("CREATE INDEX mh2_ltiasse_con_ix ON mh2_lti_assessment (contextid(255))")Command was: CREATE INDEX mh2_ltiasse_con_ix ON mh2_lti_assessment (contextid(255))
[WAR] 1b (lib/errors.php:859) Could not execute command: CREATE INDEX mh2_ltiasse_con_ix ON mh2_lti_assessment (contextid(255))
Call stack (most recent first):

    log_message("Could not execute command: CREATE INDEX mh2_ltiass...", 8, true, true) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:95
    log_warn("Could not execute command: CREATE INDEX mh2_ltiass...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:859
    SQLException->__construct("Could not execute command: CREATE INDEX mh2_ltiass...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/dml.php:181
    execute_sql("CREATE INDEX mh2_ltiasse_con_ix ON mh2_lti_assessm...") at /home/ceciliavg/maharacode/mahara/htdocs/lib/dml.php:1661
    execute_sql_arr(array(size 1), true, true) at /home/ceciliavg/maharacode/mahara/htdocs/lib/ddl.php:1331
    add_index(object(XMLDBTable), object(XMLDBIndex)) at /home/ceciliavg/maharacode/mahara/htdocs/module/lti/lib.php:43
    PluginModuleLti::postinst("2018071009") at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:1818
    call_static_method("PluginModuleLti", "postinst", "2018071009") at /home/ceciliavg/maharacode/mahara/htdocs/lib/upgrade.php:621
    upgrade_plugin(object(stdClass)) at /home/ceciliavg/maharacode/mahara/htdocs/admin/upgrade.json.php:84

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11172

no longer affects: mahara
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/11257

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11257
Committed: https://git.mahara.org/mahara/mahara/commit/3d7d15aa8fb7b554e3ebd534d4f49974a34062da
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 3d7d15aa8fb7b554e3ebd534d4f49974a34062da
Author: Cecilia Vela Gurovic <email address hidden>
Date: Mon Aug 24 14:33:21 2020 +1200

Bug 1892660: adding version bump for lti plugin

and fix checking if index exists

behatnotneeded

Change-Id: Ia85ae5abfc64d5e1ea6330074a3024ca025f9a67

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11172
Committed: https://git.mahara.org/mahara/mahara/commit/2830baa82f4dd41631947cd1b3365045ad5a57c7
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit 2830baa82f4dd41631947cd1b3365045ad5a57c7
Author: Cecilia Vela Gurovic <email address hidden>
Date: Mon Aug 24 14:33:21 2020 +1200

Bug 1892660: adding version bump for lti plugin

and fix checking if index exists

behatnotneeded

Change-Id: Ia85ae5abfc64d5e1ea6330074a3024ca025f9a67

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/11258

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11258
Committed: https://git.mahara.org/mahara/mahara/commit/5f327d81bc485e8c1d3e6d53fb21963f5197df05
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.10_STABLE

commit 5f327d81bc485e8c1d3e6d53fb21963f5197df05
Author: Cecilia Vela Gurovic <email address hidden>
Date: Mon Aug 24 14:33:21 2020 +1200

Bug 1892660: adding version bump for lti plugin

and fix checking if index exists

behatnotneeded

Change-Id: Ia85ae5abfc64d5e1ea6330074a3024ca025f9a67
(cherry picked from commit 2830baa82f4dd41631947cd1b3365045ad5a57c7)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.04_STABLE" branch: https://reviews.mahara.org/11259

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11259
Committed: https://git.mahara.org/mahara/mahara/commit/e4cabd3728007a38f49ed1be3362340cd4e77335
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.04_STABLE

commit e4cabd3728007a38f49ed1be3362340cd4e77335
Author: Cecilia Vela Gurovic <email address hidden>
Date: Mon Aug 24 14:33:21 2020 +1200

Bug 1892660: adding version bump for lti plugin

and fix checking if index exists

behatnotneeded

Change-Id: Ia85ae5abfc64d5e1ea6330074a3024ca025f9a67
(cherry picked from commit 2830baa82f4dd41631947cd1b3365045ad5a57c7)
(cherry picked from commit 5f327d81bc485e8c1d3e6d53fb21963f5197df05)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.