Upgrade from 15.04 -> 17.10 fails on logoxs not found

Bug #1717371 reported by Robert Lyon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

When upgrading from 15.04 -> 17.10 the upgrade process fails at step

   if ($oldversion < 2015082500) {
        // Add a site default portfolio page template
        log_debug('Add a site default portfolio page template');
        ...
   }

This is because there is a call to load_user_institutions() which expects the 'logoxs' column but that does not exist yet (it is added later in the upgrade).

As upgrade is run by user id = 0 we can ignore the institution check for them (they won't have any institutions anyway).

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

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

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

Reviewed: https://reviews.mahara.org/8016
Committed: https://git.mahara.org/mahara/mahara/commit/589e4aebe45f6820b24487d142b21a9ddddab329
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 589e4aebe45f6820b24487d142b21a9ddddab329
Author: Robert Lyon <email address hidden>
Date: Fri Sep 15 10:07:57 2017 +1200

Bug 1717371: Upgrade fails from 15.04

Due to missing column 'logoxs' as this column has not been added yet

behatnotneeded

Change-Id: Ie744485923c1566f10081ab98f16a1e2b08baf5a
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
ma (mafen1) wrote :

This still fails for me when going from 15.10.2 to 17.10.0

Revision history for this message
Robert Lyon (robertl-9) wrote :

mafen

Are you able to add in the log error here?

I tried upgrading a site from 15.10.2 -> 17.10.0 and had no issue.

So I'm wondering what might be causing your problem so I can get it fixed

Cheers
Robert

Revision history for this message
ma (mafen1) wrote :
Download full text (4.4 KiB)

Hello Robert,

i just did a fresh restore of our 15.10.2 instance and tried to upgrade to 17.10.0

This is the whole log i get (referer changed):

[DBG] 39 (lib/db/upgrade.php:4213) Upgrade comment plugin for threaded comments, referer: https://xyz.com
[DBG] 39 (artefact/comment/db/upgrade.php:140) Adding "hidden" column to artefact_comment_comment, referer: https://xyz.com
[DBG] 39 (artefact/comment/db/upgrade.php:150) Checking for existing deleted comments that should now be hidden, referer: https://xyz.com
[DBG] 39 (lib/db/upgrade.php:4220) Expanding the size of the activity_queue.data column, referer: https://xyz.com
[DBG] 39 (lib/db/upgrade.php:4229) Upgrade wall block and add wall notifications to default inbox block, referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1054: Unknown column 'i.logoxs' in 'field list'] in EXECUTE(", referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) SELECT u.institution,IF(ctime >= '1970-01-01', UNIX_TIMESTAMP(ctime), TIMESTAMPDIFF(SECOND, '1970-01-01', ctime)) AS ctime,IF(u.expiry >= '1970-01-01', UNIX_TIMESTAMP(u.expiry), TIMESTAMPDIFF(SECOND, '1970-01-01', u.expiry)) AS membership_expiry,u.studentid,u.staff,u.admin,i.displayname,i.theme,i.registerallowed, i.showonlineusers,i.allowinstitutionpublicviews, i.logo, i.logoxs, i.style, i.licensemandatory, i.licensedefault, i.dropdownmenu, i.skins, i.suspended, referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) FROM "usr_institution" u INNER JOIN "institution" i ON u.institution = i.name, referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) WHERE u.usr = 60 ORDER BY i.priority DESC")Command was: , referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) SELECT u.institution,IF(ctime >= '1970-01-01', UNIX_TIMESTAMP(ctime), TIMESTAMPDIFF(SECOND, '1970-01-01', ctime)) AS ctime,IF(u.expiry >= '1970-01-01', UNIX_TIMESTAMP(u.expiry), TIMESTAMPDIFF(SECOND, '1970-01-01', u.expiry)) AS membership_expiry,u.studentid,u.staff,u.admin,i.displayname,i.theme,i.registerallowed, i.showonlineusers,i.allowinstitutionpublicviews, i.logo, i.logoxs, i.style, i.licensemandatory, i.licensedefault, i.dropdownmenu, i.skins, i.suspended, referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) FROM "usr_institution" u INNER JOIN "institution" i ON u.institution = i.name, referer: https://xyz.com
[WAR] 39 (lib/errors.php:859) WHERE u.usr = ? ORDER BY i.priority DESC and values was (0:60), referer: https://xyz.com
Call stack (most recent first):, referer: https://xyz.com
  * log_message("Failed to get a recordset: mysqli error: [1054: Un...", 8, true, true) at /var/www/html/maharatest/lib/errors.php:95, referer: https://xyz.com
  * log_warn("Failed to get a recordset: mysqli error: [1054: Un...") at /var/www/html/maharatest/lib/errors.php:859, referer: https://xyz.com
  * SQLException->__construct("Failed to get a recordset: mysqli error: [1054: Un...") at /var/www/html/maharatest/lib/dml.php:517, referer: https://xyz.com
  * get_recordset_sql(", referer: https://xyz.com
        SELECT u.institution,IF(ctime >= '1970-01...", array(size 1), "", "") at /var/www/html/maharatest/lib/dml.php:697...

Read more...

Revision history for this message
Robert Lyon (robertl-9) wrote :

As the error mentioned by mafen is related to this bug but is slightly different.
It is caused by the upgrading of the wallpost block data so I'll make a new bug report to deal with this issue.

The new bug 1728815 is now made for this

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.