error installing 2.7

error installing 2.7

by Hunter Allspaugh -
Number of replies: 5

I am installing an instance of v. 2.7 and using the moodle data from our current moodle server for testing purposes.  When moodle is going through its upgrade process from the browser, it starts off by failing on the mod_quiz module saying there was a coding error, and then it shows the following if I try to run the upgrade from within moodle again:



mod_quiz

Debug info: Data truncated for column 'slot' at row 17268
ALTER TABLE mdl_quiz_slots MODIFY COLUMN slot BIGINT(10) NOT NULL after id
Error code: ddlexecuteerror
Stack trace:
  • line 449 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 839 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 76 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 583 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 620 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
  • line 723 of /mod/quiz/db/upgrade.php: call to database_manager->change_field_notnull()
  • line 697 of /lib/upgradelib.php: call to xmldb_quiz_upgrade()
  • line 420 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1615 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 432 of /admin/index.php: call to upgrade_noncore()
Average of ratings: -
In reply to Hunter Allspaugh

Re: error installing 2.7

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You may be seeing MDL-45522 or MDL-45523 which Eric Merill found and fixed last night. Those two fixes shoudl be included in this week's 2.7+ weekly release which should be out in a few days.

In reply to Tim Hunt

Re: error installing 2.7

by Hunter Allspaugh -

Ok, great.  Thanks for the information.  I will try again at the end of the week and see if it goes differently.

In reply to Tim Hunt

Re: error installing 2.7

by Hunter Allspaugh -

Here is the latest error I am getting after the git update that was pushed out today or yesterday.


mod_quiz

DDL sql execution error

More information about this error

Debug info: Data truncated for column 'slot' at row 17268
ALTER TABLE mdl_quiz_slots MODIFY COLUMN slot BIGINT(10) NOT NULL after id
Error code: ddlexecuteerror
Stack trace:
  • line 449 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 839 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 76 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 583 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 620 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
  • line 727 of /mod/quiz/db/upgrade.php: call to database_manager->change_field_notnull()
  • line 697 of /lib/upgradelib.php: call to xmldb_quiz_upgrade()
  • line 420 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1615 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 432 of /admin/index.php: call to upgrade_noncore()
In reply to Hunter Allspaugh

Re: error installing 2.7

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'm confused by that. The error of happening at line 727 of mod/quiz/db/upgrade.php which is trying to set the slot column to be NOT NULL.

Before doing that, on line 713 we do 

        // Now, if any quiz_slots rows are left with slot or page NULL, something
        // is badly wrong.
        if ($DB->record_exists_select('quiz_slots', 'slot IS NULL OR page IS NULL')) {
            throw new coding_exception('Something went wrong in the quiz upgrade step for MDL-43749. ' .
                    'Some quiz_slots still contain NULLs which will break the NOT NULL constraints we need to add. ' .
                    'Please report this problem at http://tracker.moodle.org/ so that it can be investigated. Thank you.');
        }

Oh, I see. Back in the first post you say you got a different error the first time. Well, that was it.

So, anyway, you have some bad data in your database, which does not fit any of the patterns of bad data that the code has already been taught to clean up. If you can work out where this bad data came from, then we can probalby handle it.

So, can you work out where this bad data came from? Do you have a backup of the database from before the upgrade? Can you work out which quiz it relates to? Can you work out what happened to that quiz?

Average of ratings: Useful (1)