Moodle upgrade 2.2 to 2.7 DLL execution error

Moodle upgrade 2.2 to 2.7 DLL execution error

by Anthony Beardsell -
Number of replies: 4

Hi 

I am trying to upgrade from moodle version 2.2 to version 2.7 and keep getting a DLL execution error. 

I am on a linux cloud server.  

The upgrade gets 80% of the way through and then fails with the following message:

DDL sql execution error

More information about this error

Debug info: Lost connection to MySQL server during query

ALTER TABLE `mdl_sessions` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `state` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `userid` bigint(10) signed NOT NULL , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL 

Error code: ddlexecuteerror

Stack trace:

•line 449 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown

•line 905 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

•line 161 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure()

•line 233 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_and_lob_columns()

•line 1560 of /lib/upgradelib.php: call to xmldb_main_upgrade()

•line 361 of /admin/index.php: call to upgrade_core()


The website then reads "Site is being upgraded, please retry later."


Prior to the upgrade all the lights were green other than the following which were amber:

Plugin

Status

php_extension

intl

should be installed and enabled for best results

Intl extension is used to improve internationalization support, such as locale aware sorting.


php_setting

opcache.enable

PHP setting should be changed.

PHP opcode caching improves performance and lowers memory requirements, OPcache extension is recommended and fully supported.


Any help would be appreciated. 

Thanks

Average of ratings: -
In reply to Anthony Beardsell

Re: Moodle upgrade 2.2 to 2.7 DLL execution error

by Anthony Beardsell -

Further to this post I have tried to upgrade to moodle version 2.4 only to encounter the same error message:

DDL sql execution error

More information about this error

Debug info: Lost connection to MySQL server during query

ALTER TABLE `mdl_sessions` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `state` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `userid` bigint(10) signed NOT NULL , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL 

Error code: ddlexecuteerror


It appears after 0.38 sec and on 80% progress. 


Any help would be appreciated.

Thanks

Anthony

In reply to Anthony Beardsell

Re: Moodle upgrade 2.2 to 2.7 DLL execution error

by Ken Task -
Picture of Particularly helpful Moodlers
According to the more information about this error link:

"It will also occur during backup if moodle database user has not sql privilege: create temporary tables."

Does the user set up to access the moodle DB have access rights enough to create temporary tables?
http://www.liquidweb.com/kb/grant-permissions-to-a-mysql-user-on-linux-via-command-line/
or use whatever tool you have to access the DB - phpmyadmin? - and check grants for the DB user.

If that is not changed, expect future issues even if you are successful in upgrading.

Looks like a large mdl_sessions table has issues and that your site is using the DB for session information.   With whatever tool you have to interact with the DB for Moodle, remove all rows to mdl_sessions ... leave the table but empty it.
And, edit your config.php file to insert the following:

$CFG->dbsessions= '0';

That should set the moodle to use files based session recording ... not DB.   A 'sessions' directory should be created by Moodle in moodledata the next time anyone attempts login.

Login to the 2.2 moodle if you can.   Then check for a sessions file in moodledata/sessions to assure that is happening.

Then try the upgrade again.

Also, assume the site has met the version requirements for 2.7:
https://docs.moodle.org/dev/Moodle_2.7_release_notes#Server_requirements

'spirit of sharing', Ken
Average of ratings: Useful (1)
In reply to Ken Task

Re: Moodle upgrade 2.2 to 2.7 DLL execution error

by Anthony Beardsell -

Hi Ken

That is fantastic. Thank you.

I had already checked the permissions and they seemed ok. The problem was with the mdl_sessions. 

I emptied the tables and created the line in the config.php and that fixed it. 

All up to date now. 

I can't tell you how many times I had been around the block looking for a solution to this. 

Thank you. 


Anthony


In reply to Anthony Beardsell

Re: Moodle upgrade 2.2 to 2.7 DLL execution error

by Ken Task -
Picture of Particularly helpful Moodlers

Great!  Glad to hear it ... and you are more than welcome.  Feel free to rate the posting that resolved the issue as 'useful' so that others might find solution more quickly.

'spirit of sharing', Ken

Average of ratings: Useful (1)