← Back to team overview

mahara-contributors team mailing list archive

[Bug 1679699] Re: Upgradeing 1.9.7 => 16.04.4 causes fatal DB error

 

Hi davosmith,

I'm glad you were able to sort out your problem.

Upon looking at the code what would be useful is if we could pass in an
overriding weight/dependency value based on what needs to be upgraded
and from what version to what other version.

So that we could do the upgrades for things that add/edit/drop tables
first before doing other upgrades.

I suspect this won't be an easy change - so for the interim I'll note
here that upgrading from one major version to the next to the next
should be fine to do

Cheers

Robert

** Changed in: mahara
       Status: New => Confirmed

** Changed in: mahara
     Assignee: (unassigned) => Robert Lyon (robertl-9)

** Changed in: mahara
   Importance: Undecided => Medium

** Changed in: mahara
    Milestone: None => 17.04.1

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1679699

Title:
  Upgradeing 1.9.7 => 16.04.4 causes fatal DB error

Status in Mahara:
  Confirmed

Bug description:
  Error:
  [WAR] 75 (lib/dml.php:514) Failed to get a recordset: mysqli error: [1146: Table 'mahara_new.artefact_file_embedded' doesn't exist] in EXECUTE("SELECT "id" FROM "artefact_file_embedded"  WHERE "fileid" = '11498'  AND "resourcetype" = 'blogpost'  AND "resourceid" = '11534' ")
  [WAR] 75 (lib/dml.php:514) Command was: SELECT "id" FROM "artefact_file_embedded"  WHERE "fileid" = ?  AND "resourcetype" = ?  AND "resourceid" = ?  and values was (0:11498,1:blogpost,2:11534)
  Call stack (most recent first):
    * get_recordset_sql(string(size 108), array(size 3)) at /var/www/html/mahara/lib/dml.php:825
    * get_field_sql(string(size 108), array(size 3)) at /var/www/html/mahara/lib/dml.php:813
    * get_field(string(size 22), string(size 2), string(size 6), string(size 5), string(size 12), string(size 8), string(size 10), string(size 5)) at /var/www/html/mahara/lib/embeddedimage.php:94
    * EmbeddedImage::prepare_embedded_images(string(size 624), string(size 8), string(size 5), null, string(size 3)) at /var/www/html/mahara/artefact/blog/db/upgrade.php:76
    * xmldb_artefact_blog_upgrade(string(size 10)) at /var/www/html/mahara/lib/upgrade.php:418
    * upgrade_plugin(object(stdClass)) at /var/www/html/mahara/lib/mahara.php:266
    * upgrade_mahara(array(size 1)) at /var/www/html/mahara/admin/cli/upgrade.php:53

  The reason is that the artefact.blog upgrade for version 2015011501
  assumes that the artefact.file upgrade for 2015111200 has already
  taken place and, hence, that the table 'artefact_file_embedded' has
  been created.

  This is not the case for an upgrade from 1.9.7 to 16.04.4.

  To work around this I've forced artefact.file to be the first artefact
  to be upgraded, by adding the following code to 'sort_upgrades':

      if ($weight1 == $weight2) {
          if ($k1 == 'artefact.file') {
              return -1;
          } else if ($k2 == 'artefact.file') {
              return 1;
          }
      }

  This is a temporary change to make sure that the upgrade can be
  completed (which it has now done), but reporting here in the hope that
  this will save anyone else having similar problems.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1679699/+subscriptions


References