2.2 to 2.3 upgrade fails on final step

2.2 to 2.3 upgrade fails on final step

by Doug Moody -
Number of replies: 14

I am attempting to update from 2.2 to 2.3 and get the following message and screen every time. CIt stops at 41.86% in something to do with "unsigned columns"

Can anyone give me some guidance please?

error/invalidmysqlnativetype

More information about this error

Debug info:
Error code: invalidmysqlnativetype
$a contents: double unsigned
Stack trace:
  • line 641 of /lib/dml/mysqli_native_moodle_database.php: dml_exception thrown
  • line 534 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->mysqltype2moodletype()
  • line 460 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->get_column_info()
  • line 522 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_columns()
  • line 1551 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
  • line 60 of /lib/db/upgradelib.php: call to moodle_database->count_records()
  • line 232 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_columns()
  • line 1481 of /lib/upgradelib.php: call to xmldb_main_upgrade()
  • line 275 of /admin/index.php: call to upgrade_core()
Average of ratings: -
In reply to Doug Moody

Re: 2.2 to 2.3 upgrade fails on final step

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Can we tell which table it is referring to? One possibility, although a long shot, is this an upgrade from a v1.9 to v2.2 to v2.3? Could there be columns that should have been dumped during the upgrade to v2.2 but were not? Perhaps the datatype was not changed in the initial upgrade and v2.3 hiccoughs on it, expecting signed and getting unsigned type. 

In reply to Colin Fraser

Re: 2.2 to 2.3 upgrade fails on final step

by Doug Moody -

Colin,

Yes, I suppose that's a possibility. Like most people, I have run an upgrade path over the years. But my current version 2.2 has been running fine, and before that, I upgraded from 2.1, etc.

I think a more plausible possibility is that the upgrades (the new plugins particularly) that are now part of the core is what it is choking on.

I am curious if anyone else has seen this behavior? Of course, 2.3 is still beta, and I expected some issues, but not in the initial installation! I can't beta test something I can't install!

In reply to Doug Moody

Re: 2.2 to 2.3 upgrade fails on final step

by Dan Poltawski -
Hi Doug,

From the looks of the debugging output it seems like you've got some invalid tables/fields in your database, it seems very unusual. Are you running any other applications in the same database or have you created any new tables in the same database? Have you created any altered any fields in the database?

I've created MDL-33984 in the tracker to investigate.
Average of ratings:Useful (2)
In reply to Doug Moody

Re: 2.2 to 2.3 upgrade fails on final step

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Doug,

could you try to execute this against your DB:

SELECT table_name, column_name, data_type, column_type
FROM information_schema.columns
WHERE table_schema = 'YOUR_DB_NAME_GOES_HERE'
AND data_type LIKE 'double%';

And confirm for which table_name and column_name (if any) you're getting "double unsigned" in the data_type column?

It's really strange, I've tried here forcing some columns to go to double unsigned and I never get "double unsigned" in that column, just "double", with the specifications of the field (unsigned, ....) going to the column_type column, not to the data_type one.

Also, if you can comment there the exact MySQL version you're using... that will help to look for bugs and friends.

Please, post comments @ MDL-33984, TIA!

In reply to Eloy Lafuente (stronk7)

Re: 2.2 to 2.3 upgrade fails on final step

by Christos Rodosthenous -

Same problem Here. Upgrade from moodle 2.2.3+ to moodle 2.3 stable FAILS.

OS RHEL 6

Mysql: 5.1.61

Php: PHP 5.3.3 (cli) (built: May  3 2012 17:33:17)

In reply to Christos Rodosthenous

Re: 2.2 to 2.3 upgrade fails on final step

by Christos Rodosthenous -

I run the query and got:

mdl_lesson_grades    grade    double    double
mdl_scorm    maxgrade    double    double
mdl_workshop_assessments_old    grade    double    double
mdl_workshop_elements_old    stddev    double    double

In reply to Christos Rodosthenous

Re: 2.2 to 2.3 upgrade fails on final step

by John St -

I have the same issue, I ran the query and get:

mdl_lesson_grades grade double double unsigned

mdl_scorm maxgrade double double

mdl_workshop_assessments_old grade double double

 

mdl_workshop_elements_old stddev double double

So what is the process from here? Convert these to a differen field type? 

In reply to John St

Re: 2.2 to 2.3 upgrade fails on final step

by John St -

As a note I am running mysql version 5.1.54-1ubuntu4

In reply to Christos Rodosthenous

Re: 2.2 to 2.3 upgrade fails on final step

by llywelyn morgan -

same here.

we're getting 'error writing to database' after clicking notifications.

In reply to Doug Moody

Re: 2.2 to 2.3 upgrade fails on final step

by Robert Wilson -

I'm attempting to upgrade Moodle from 2.2.2+ to 2.3.1+ and am having a similar issue. The server checks show everything is OK. The upgrade gets to "Converted unsigned columns in MySQL database - 130/289." and hangs. During this period, the mysqld daemon uses a large percentage of the CPU. I've waited a couple hours before losing patience and reverting and trying again. 

Upgrading to 2.2.4+ worked fine. Upgrading from 2.2.4+ to 2.3.1+ hangs at about the same place. Does anyone have any suggestions? 

Thanks, Robert

In reply to Robert Wilson

Re: 2.2 to 2.3 upgrade fails on final step

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi all,

If you are able to run the upgrade again, then I suggest first editing '/lib/db/upgradelib.php' and moving line 82:

$pbar->update($i, $tablecount, "Converted unsigned columns in MySQL database - $i/$tablecount.");

to above line 60:

$count = $DB->count_records($table, array());

and change to:

$pbar->update($i, $tablecount, "Converting '$table' unsigned columns in MySQL database - $i/$tablecount.");

i.e.:

$i++;
// set appropriate timeout - 5 minutes per milion of records should be enough, min 60 minutes just in case
$pbar->update($i, $tablecount, "Converting '$table' unsigned columns in MySQL database - $i/$tablecount.");
$count = $DB->count_records($table, array());

so that you can see visually what table is causing the issue when it hangs.

Cheers,

Gareth

In reply to Robert Wilson

Re: 2.2 to 2.3 upgrade fails on final step

by Robert Wilson -

I left this running when I left work. I received an email from the server about the Google OAuth changes about 3.5 hours later.

When I came into work this morning, the web page was stuck at the same place it was when I left. Refreshing the page showed the new settings page. It looks like the upgrade worked. It was the longest upgrade I've had for Moodle. I wonder if the status could give more detail about what is going on.

In reply to Robert Wilson

Re: 2.2 to 2.3 upgrade fails on final step

by CP Lau -

Yes, we encounter the same issue. We are running Moodle 2.2 with MySQL 5.5. We have upgraded from 2.2 to 2.3 three times, only the first time is successful. The other 2 times are failed after 3-4 hours with out of memory error returned by MySQL when the sql statement "ALTER TABLE `mdl_log` MODIFY COLUMN `time` bigint(10) signed NOT NULL DEFAULT '0'" was running. Our mdl_log is a huge table with > 4.5 million records. We find that the upgrade consumes a lot of memory on the mysql server during upgrade, is there any memory leak issue with the Moodle 2.3 upgrade script? Nonetheless, this is the the longest Moodle upgrade (e.g. 5 hours) i have had so far.

Thanks for your advice.