Robert,

I've also run into similar problem when upgrading from 1.6.10 to
17.04.2.

See one of the call stacks below (there are 3, please see attached for the 
whole thing)
--------------------------------------------------------------------------

Call stack (most recent first):
  * log_message("Array to string conversion", 8, true, true, 
"/vagrant/cqu-mahara/htdocs/lib/adodb/adodb-excepti...", 45) at 
/vagrant/cqu-mahara/htdocs/lib/errors.php:521
  * error(8, "Array to string conversion", 
"/vagrant/cqu-mahara/htdocs/lib/adodb/adodb-excepti...", 45, array(size 7)) at 
/vagrant/cqu-mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:45
  * ADODB_Exception->__construct("postgres8", "adodb_throw", -18, "ERROR:  
relation "artefact_file_embedded" does not...", "SELECT * FROM 
"artefact_file_embedded" WHERE resou...", array(size 2), 
object(ADODB_postgres8)) at 
/vagrant/cqu-mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:80
  * adodb_throw("postgres8", "adodb_throw", -18, "ERROR:  relation 
"artefact_file_embedded" does not...", "SELECT * FROM "artefact_file_embedded" 
WHERE resou...", array(size 2), object(ADODB_postgres8)) at 
/vagrant/cqu-mahara/htdocs/lib/adodb/adodb.inc.php:313
  * ADODB_TransMonitor("postgres8", "EXECUTE", -18, "ERROR:  relation 
"artefact_file_embedded" does not...", "SELECT * FROM "artefact_file_embedded" 
WHERE resou...", array(size 2), object(ADODB_postgres8)) at 
/vagrant/cqu-mahara/htdocs/lib/adodb/adodb.inc.php:1264
  * ADOConnection->_Execute("SELECT * FROM "artefact_file_embedded" WHERE 
resou...", array(size 2)) at 
/vagrant/cqu-mahara/htdocs/lib/adodb/adodb.inc.php:1224
  * ADOConnection->Execute("SELECT * FROM "artefact_file_embedded" WHERE 
resou...", array(size 2)) at /vagrant/cqu-mahara/htdocs/lib/dml.php:510
  * get_recordset_sql("SELECT * FROM "artefact_file_embedded" WHERE resou...", 
array(size 2)) at /vagrant/cqu-mahara/htdocs/lib/dml.php:466
  * get_recordset_select("artefact_file_embedded", "resourcetype = ? AND 
resourceid = ?", array(size 2), "", "*", "", "") at 
/vagrant/cqu-mahara/htdocs/lib/dml.php:666
  * get_records_select_array("artefact_file_embedded", "resourcetype = ? AND 
resourceid = ?", array(size 2)) at 
/vagrant/cqu-mahara/htdocs/lib/embeddedimage.php:196
  * EmbeddedImage::remove_embedded_images("wallpost", "815") at 
/vagrant/cqu-mahara/htdocs/lib/embeddedimage.php:69
  * EmbeddedImage::prepare_embedded_images("This document contains my three 
thinking pieces ht...", "wallpost", "815", null, "2301") at 
/vagrant/cqu-mahara/htdocs/blocktype/wall/db/upgrade.php:25
  * xmldb_blocktype_wall_upgrade("2009111200") at 
/vagrant/cqu-mahara/htdocs/lib/upgrade.php:423
  * upgrade_plugin(object(stdClass)) at 
/vagrant/cqu-mahara/htdocs/lib/db/upgrade.php:4231
  * xmldb_core_upgrade("2012080627") at 
/vagrant/cqu-mahara/htdocs/lib/upgrade.php:347
  * upgrade_core(object(stdClass)) at 
/vagrant/cqu-mahara/htdocs/lib/mahara.php:268
  * upgrade_mahara(array(size 1)) at 
/vagrant/cqu-mahara/htdocs/admin/cli/upgrade.php:53

----------------------------------------------------------------------------

>From looking at the code, Ghada and I discovered that upgrade check of
"2016012800" (in /htdocs/lib/db/upgrade.php, line 4228) was trying to
get data from "artefact_file_embedded". And of course the table didn't
exist. So we traced back when to where "artefact_file_embedded" would
have been created and it is in "2014111200"
(/htdocs/file/db/upgrade.php, line 403). We couldn't see check_upgrades
for 'artefact.file' called anywhere in /lib/db/upgrade.php. So we
basically added check_upgrades.

----------------------------------------------------------------------------
if ($oldversion < 2016012800) {
        log_debug('Upgrade wall block and add wall notifications to default 
inbox block');
        
        if ($data = check_upgrades('artefact.file')) {
                upgrade_plugin($data);
        }
        if ($data = check_upgrades('blocktype.wall')) {
                upgrade_plugin($data);
        }
        
        ... MORE CODE ...
}
-----------------------------------------------------------------------------

We would like to upstream it but weeing your comment above, I'm not sure
if this would fix for all.

:D
Pat

-- 
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:
  Upgrading 1.9.7 => 16.04.4 causes fatal DB error

Status in Mahara:
  Confirmed
Status in Mahara 17.10 series:
  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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to