Forums | Mahara Community

Support /
Database errors upgrading to 1.2.5


Howard Miller's profile picture
Posts: 191

23 August 2010, 8:49

I am attempting to upgrade from 1.1.3 to 1.2.5. 

My database is pre somebody making a decision to enforce UTF8 so I am stuck with a latin1 database. I don't know if this is relevant. When I attempt the upgrade after some time I get the error message for the core component...

Failed to get a recordset: mysql error: [1054: Unknown column 'filetype' in 'where clause'] in adodb_throw(SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream', ) Command was: SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream'

Call stack (most recent first):

  • get_recordset_sql("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0), "", "") at/var/www/mahara/htdocs/lib/dml.php:650
  • get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0)) at/var/www/mahara/htdocs/lib/db/upgrade.php:1314
  • xmldb_core_upgrade("2008040204") at/var/www/mahara/htdocs/lib/upgrade.php:297
  • upgrade_core(object(stdClass)) at/var/www/mahara/htdocs/admin/upgrade.json.php:93
Does this look familiar to anyone??  
Here's the full version from the Apache error log:
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] [WAR] c7 (lib/errors.php:738) Failed to get a recordset: mysql error: [1054: Unknown column 'filetype' in 'where clause'] in adodb_throw(SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream', ), referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] [WAR] c7 (lib/errors.php:738) Command was: SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream', referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] Call stack (most recent first):, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * log_message("Failed to get a recordset: mysql error: [1054: Unk...", 8, true, true) at /var/www/mahara/htdocs/lib/errors.php:111, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * log_warn("Failed to get a recordset: mysql error: [1054: Unk...") at /var/www/mahara/htdocs/lib/errors.php:738, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * SQLException->__construct("Failed to get a recordset: mysql error: [1054: Unk...") at /var/www/mahara/htdocs/lib/dml.php:467, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * get_recordset_sql("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0), "", "") at /var/www/mahara/htdocs/lib/dml.php:650, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0)) at /var/www/mahara/htdocs/lib/db/upgrade.php:1314, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * xmldb_core_upgrade("2008040204") at /var/www/mahara/htdocs/lib/upgrade.php:297, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * upgrade_core(object(stdClass)) at /var/www/mahara/htdocs/admin/upgrade.json.php:93, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] , referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] [WAR] c7 (lib/errors.php:738) Failed to get a recordset: mysql error: [1054: Unknown column 'filetype' in 'where clause'] in adodb_throw(SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream', ), referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] [WAR] c7 (lib/errors.php:738) Command was: SELECT * FROM "artefact_file_files" WHERE filetype='application/octet-stream', referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] Call stack (most recent first):, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * log_message("Failed to get a recordset: mysql error: [1054: Unk...", 8, true, true) at /var/www/mahara/htdocs/lib/errors.php:111, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * log_warn("Failed to get a recordset: mysql error: [1054: Unk...") at /var/www/mahara/htdocs/lib/errors.php:738, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * SQLException->__construct("Failed to get a recordset: mysql error: [1054: Unk...") at /var/www/mahara/htdocs/lib/dml.php:467, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * get_recordset_sql("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0), "", "") at /var/www/mahara/htdocs/lib/dml.php:650, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * get_records_sql_array("SELECT * FROM {artefact_file_files} WHERE filetype...", array(size 0)) at /var/www/mahara/htdocs/lib/db/upgrade.php:1314, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * xmldb_core_upgrade("2008040204") at /var/www/mahara/htdocs/lib/upgrade.php:297, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1]   * upgrade_core(object(stdClass)) at /var/www/mahara/htdocs/admin/upgrade.json.php:93, referer: http://localhost/mahara/htdocs/admin/upgrade.php
[Mon Aug 23 14:45:34 2010] [error] [client 127.0.0.1] , referer: http://localhost/mahara/htdocs/admin/upgrade.php
Howard Miller's profile picture
Posts: 191

23 August 2010, 9:18

Ok, further info. The upgrade code that is being run executes this...

"SELECT * FROM {artefact_file_files} WHERE filetype='application/octet-stream'"

However, the description of the table is this...

mysql> describe artefact_file_files;
+--------------+------------+------+-----+---------+-------+
| Field        | Type       | Null | Key | Default | Extra |
+--------------+------------+------+-----+---------+-------+
| artefact     | bigint(10) | NO   | MUL | NULL    |       |
| size         | bigint(10) | YES  |     | NULL    |       |
| oldextension | text       | YES  |     | NULL    |       |
+--------------+------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> describe artefact_file_files;

+--------------+------------+------+-----+---------+-------+

| Field        | Type       | Null | Key | Default | Extra |

+--------------+------------+------+-----+---------+-------+

| artefact     | bigint(10) | NO   | MUL | NULL    |       |

| size         | bigint(10) | YES  |     | NULL    |       |

| oldextension | text       | YES  |     | NULL    |       |

+--------------+------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

So, there is no field called 'filetype' so it's not surprising it fails. Thoughts??
Howard Miller's profile picture
Posts: 191

23 August 2010, 9:38

Answering my own question. Definitely a bug :(

 

https://bugs.launchpad.net/mahara/+bug/622763

anonymous profile picture
Account deleted
Posts: 808

23 August 2010, 16:46

Howard,

Sorry you had to spend time getting frustrated by this.  As mentioned on that bug report it was fixed a while ago, but we haven't got around to putting out another stable release yet.

If anyone else is having the same problem, please grab the latest 1.2 tarball from http://gitorious.org/mahara/mahara/archive-tarball/1.2_STABLE until the next stable release (1.2.6).

R.

4 results