Upgrade to 15.10 fails for sites that have upgraded Mahara by copying over their existing installation

Bug #1519516 reported by Aaron Wells on 2015-11-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aaron Wells
Aaron Wells
Aaron Wells

Bug Description

I've now encountered two users on the support forums who had issues upgrading because they had copied over their existing Mahara site, and now have duplicate methods defined in the (old) multirecipient artefact plugin and the (new) multirecipient module plugin:



This was caused because in Bug 1468156, we refactored this plugin from an artefact to a module. Apparently some users upgrade their sites through this process:

1. Download & unzip the new release
2. Copy the release into their existing Mahara webroot
3. When prompted, replace existing files in the webroot with new versions from the zip.

The problem is this leaves the old files in place. Thus far, this approach has not caused any crashes, though I imagine it might lead to some strange behaviors, like possibly extra CSS files getting loaded, and the redundant ContactInfo block still being around. But the multirecipient module is perhaps the first case of us moving a library file from one location to another, and that results in the user having two library files that define some methods with the same name, and that causes a fatal PHP error.

Since this has been common enough to come up twice in the forum, it would probably be a good idea to address it somehow.

Aaron Wells (u-aaronw) wrote :

Filed a related bug 1519519 for the idea of putting in a sanity check to warn users off of this practice.

In the meantime, I think I'm just going to tackle this with this approach:

1. Make sure our official upgrade documentation is not telling people to upgrade by copying over their existing installation.

2. Rename the methods in the multiplerecipientnotification module so that they don't conflict with the names of the methods in the old artefact.

I think if I do #2 above, then there probably won't be any problems caused by the old artefact. The files will be there, and they'll still be loaded whenever you load up an artefact, but we won't actually use them for anything.

Though I will have to check and make sure that the artefact doesn't have any crons or event handlers that might be getting triggered as well.

description: updated
Aaron Wells (u-aaronw) wrote :

I wrote up a quick patch for this: https://reviews.mahara.org/#/c/5767/

But the results weren't really "fixed". The upgrade ran fine (I did it from the CLI; didn't try the web-based upgrader), but the CSS on the site was 90% broken. It looks like this is because the old theme "static/style" directories were still there, and the Theme code checks in that location before checking for the new base "style" directory where the real theme files were. So I had 15.10 HTML, with 15.04 CSS, and few of the styles matched up and worked correctly.

Ignoring that, I logged in anyway and went to the admin screen. There, the upgrader asked me to upgrade the multirecipient module, and install the multirecipient artefact! Which, of course it would, because we essentially uninstall the multirecipient artefact during upgrade, but since its files are still in place, that prompts Mahara to ask you to re-install it.

So I'm abandoning that patch because it doesn't really solve the problem and may, in fact, cause more problems.

I'll see about making sure the upgrade documentation is correct, instead.

Aaron Wells (u-aaronw) wrote :

Okay, the README.md file points users to the wiki for upgrade advice. And the wiki *already* tells you that extracting the new code over the old code is not recommended because of these sorts of issues.

I've updated it make this even clearer, and I've added a section to the FAQ at the end, with the specific PHP error caused when you upgrade to 15.10 in this way: https://wiki.mahara.org/wiki/System_Administrator's_Guide/Upgrading_Mahara#Q:_PHP_Fatal_error:_Cannot_redeclare_get_message_thread_mr.28.29

Aaron Wells (u-aaronw) wrote :

... and now that's resolved, updating this bug to "Won't fix", to indicate that we haven't and won't be making any code changes to make Mahara compatible with copy-over upgrading.

We still might want to put in place a sanity check to detect copy-over upgrading. As mentioned above, that's been spun off into a separate bug: https://bugs.launchpad.net/bugs/1519519

Robert Lyon (robertl-9) on 2016-11-06
Changed in mahara:
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers