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
Patch for "20.04_STABLE" branch: https:/ /reviews. mahara. org/11172