Installation help

Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'

 
 
Picture of Eric Oberle
Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'
 

Hello, 

I'm trying to upgrade moodle from 2.3.2 to 2.4 and the upgrade script is failing.  I'm trying to do it from the command line.  Does anyone have a clue as to what these error messages mean?

Thanks, 

eric

-->Language import utility: en_us
++ Language pack en_us is up-to-date ++
-->System
Default exception handler: DDL sql execution error Debug: Data truncated for column 'uuid' at row 47
ALTER TABLE mdl_event MODIFY COLUMN uuid VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' after visible
Error code: ddlexecuteerror
* line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
* line 77 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
* line 586 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
* line 598 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
* line 1308 of /lib/db/upgrade.php: call to database_manager->change_field_precision()
* line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
* line 153 of /admin/cli/upgrade.php: call to upgrade_core()

!!! DDL sql execution error !!!
!! Data truncated for column 'uuid' at row 47
ALTER TABLE mdl_event MODIFY COLUMN uuid VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' after visible
Error code: ddlexecuteerror !!
!! Stack trace: * line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
* line 77 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
* line 586 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
* line 598 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
* line 1308 of /lib/db/upgrade.php: call to database_manager->change_field_precision()
* line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
* line 153 of /admin/cli/upgrade.php: call to upgrade_core()
!!

 
Average of ratings: -
Picture of Geoff Waring
Re: Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'
 

I have the same problem during an upgrade from 2.33 to 2.4

Error: DDL sql execution error

Debug info: Data truncated for column 'uuid' at row 9
ALTER TABLE mdl_event MODIFY COLUMN uuid VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' after visible
Error code: ddlexecuteerror
Stack trace:
  • line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 77 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
  • line 586 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 598 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
  • line 1308 of /lib/db/upgrade.php: call to database_manager->change_field_precision()
  • line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
  • line 284 of /admin/index.php: call to upgrade_core()

Any ideas?

Saw tracker MDL-37016 has this as unresolved.

 
Average of ratings: -
Picture of Ken Task
Re: Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'
Group Particularly helpful Moodlers

Read the comment in the tracker link you've provided.  It says:

"I went into the mySQL data and removed all the NULL characters from uuid column in the mdl_event table by hand. After that, moodle upgraded to 2.4 with no further issues."

Have upgraded a 2.3.3 to a 2.4 and had no issues.  The mdl_events table has a uuid field with no data in it.  Think that's what this:

NOT NULL DEFAULT '' after visible

refers to.

'' isn't 'null' default, but, instead, no data.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Eric Oberle
Re: Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'
 

Ok, that is the right answer....I don't know why it did this in the first place...but in my case I was able to fix it by going into mysql and issuing the command

update mdl_event set `uuid` = "" where `uuid` is null;

You'll want to adjust the table or column name appropriately...but this did resolve it without (ugh) having to edit 450 rows by hand

-e

 
Average of ratings: -
Picture of Geoff Waring
Re: Failed upgrade from 2.3.2 to 2.4 -Data truncated for column 'uuid'
 

This solution (removing the NULL characters from uuid column in mdl_events table) worked for me. The upgrade ran successfully after that. I used phpmyadmin to access the tables for editing. The command Eric Oberle provided was a much quicker way than manually editing each row. Many thanks.

 
Average of ratings: -