CLI upgrader can't handle plugin forced-installs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Aaron Wells |
Bug Description
Another side-effect from Bug1311428. The problem occurs when you're trying to run a site upgrade, where the core upgrade includes a forced install of a new plugin (such as we have for the new blocktype/text plugin).
This used to work -- you can see in lib/db/upgrade.php that we installed several earlier core plugins this way. The most recent was artefact/comment, installed as part of the Mahara 1.5.0 upgrade.
But, the change for Bug 1311428 causes not-yet-installed plugins to be included in the return results from check_upgrades(), and then assumes that the calling script will filter these out. The GUI upgrader was modified to filter these out, but the CLI upgrader was not.
To replicate:
1. Install Mahara 1.9
2. Check out the current 1.10 HEAD
3. Run the command-line upgrader (sudo -u www-data php /path/to/
Expected result: Should upgrade smoothly
Actual result: Errors out trying to upgrade blocktype.text:
(master)
[INF] 61 (admin/
[INF] 61 (lib/mahara.
[INF] 61 (lib/mahara.
[INF] 61 (lib/mahara.
[WAR] 61 (lib/errors.
[WAR] 61 (lib/errors.
[WAR] 61 (lib/errors.
Call stack (most recent first):
* log_message("Failed to get a recordset: postgres7 error: [-5: E...", 8, true, true) at /home/aaronw/
* log_warn("Failed to get a recordset: postgres7 error: [-5: E...") at /home/aaronw/
* SQLException-
* insert_
* upgrade_
* upgrade_
[WAR] 61 (lib/dml.php:1046) Failed to get a recordset: postgres7 error: [-5: ERROR: duplicate key value violates unique constraint "blocinst_nam_pk"
[WAR] 61 (lib/dml.php:1046) DETAIL: Key (name)=(text) already exists.] in adodb_throw(INSERT INTO "blocktype_
[WAR] 61 (lib/dml.php:1046) Command was: INSERT INTO "blocktype_
Call stack (most recent first):
* insert_
* upgrade_
* upgrade_
A nonrecoverable error occurred. This probably means you have encountered a bug in the system(
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
assignee: | nobody → Aaron Wells (u-aaronw) |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
I'm not sure what the best fix is here. We *do* need check_upgrades() to return data about the uninstalled plugins, so that it can be displayed in the list of "new plugins to install" on admin/upgrade.php. Maybe we should move the uninstalled plugins list to the "settings" array of check_upgrades()?