"Unknown error" when duplicating activity

"Unknown error" when duplicating activity

by Neil Haskins -
Number of replies: 2

I'm running Moodle 3.2.1+ (Build: 20170303) on Windows, using XAMPP with Mariadb 10.2.5 and PHP 5.6.11.


When I try to duplicate an activity, I get a error message "unknown error".

In my PHP error log, it says: Default exception handler: DDL sql execution error Debug: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.

Is this something to do with my setup, or is this a Moodle issue? And either way, how do I fix it?


The full error message from the php error log is:


[05-May-2017 20:32:48 Europe/Berlin] Default exception handler: DDL sql execution error Debug: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
CREATE TEMPORARY TABLE mdl_backup_ids_temp (
    id BIGINT(10) NOT NULL auto_increment,
    backupid VARCHAR(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'df35e193c6b9f5f2d64932f2e0a74f79',
    itemname VARCHAR(160) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
    itemid BIGINT(10) NOT NULL,
    newitemid BIGINT(10) NOT NULL DEFAULT 0,
    parentitemid BIGINT(10),
    info LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT  PRIMARY KEY (id)
) DEFAULT COLLATE utf8mb4_general_ci ROW_FORMAT=Compressed
;
CREATE INDEX mdl_backidstemp_bacitepar_ix ON mdl_backup_ids_temp (backupid, itemname, parentitemid)
;
CREATE INDEX mdl_backidstemp_bacitenew_ix ON mdl_backup_ids_temp (backupid, itemname, newitemid)
;
CREATE UNIQUE INDEX mdl_backidstemp_baciteite_uix ON mdl_backup_ids_temp (backupid, itemname, itemid)

Error code: ddlexecuteerror
* line 485 of \lib\dml\moodle_database.php: ddl_change_structure_exception thrown
* line 1000 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 77 of \lib\ddl\database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
* line 467 of \lib\ddl\database_manager.php: call to database_manager->execute_sql_arr()
* line 139 of \backup\util\dbops\backup_controller_dbops.class.php: call to database_manager->create_temp_table()
* line 41 of \backup\moodle2\backup_stepslib.php: call to backup_controller_dbops::create_backup_ids_temp_table()
* line 34 of \backup\util\plan\backup_execution_step.class.php: call to create_and_clean_temp_stuff->define_execution()
* line 181 of \backup\util\plan\base_task.class.php: call to backup_execution_step->execute()
* line 177 of \backup\util\plan\base_plan.class.php: call to base_task->execute()
* line 120 of \backup\util\plan\backup_plan.class.php: call to base_plan->execute()
* line 322 of \backup\controller\backup_controller.class.php: call to backup_plan->execute()
* line 3284 of \course\lib.php: call to backup_controller->execute_plan()
* line 3230 of \course\lib.php: call to duplicate_module()
* line 118 of \course\rest.php: call to mod_duplicate_activity()


[05-May-2017 20:32:48 Europe/Berlin] Potential coding error - existing temptables found when disposing database. Must be dropped!

[05-May-2017 20:32:48 Europe/Berlin] PHP Fatal error:  Uncaught exception 'ddl_change_structure_exception' with message 'DDL sql execution error' in C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\moodle_database.php:485
Stack trace:
#0 C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\mysqli_native_moodle_database.php(1000): moodle_database->query_end(false)
#1 C:\xampp5.6.11\htdocs\lms-hcos\lib\ddl\database_manager.php(77): mysqli_native_moodle_database->change_database_structure(Array, Array)
#2 C:\xampp5.6.11\htdocs\lms-hcos\lib\ddl\database_manager.php(332): database_manager->execute_sql_arr(Array, Array)
#3 C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\moodle_temptables.php(140): database_manager->drop_table(Object(xmldb_table))
#4 C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\moodle_database.php(398): moodle_temptables->dispose()
#5 C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\mysqli_native_moodle_database.php(565): moodle_database->dispose()
#6 C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\moodle_database.php(157): mysqli_native_moodle_database->dispose()
#7 [internal function]: moodle_database->__des in C:\xampp5.6.11\htdocs\lms-hcos\lib\dml\moodle_database.php on line 485

[05-May-2017 20:32:48 Europe/Berlin] PHP Stack trace:

[05-May-2017 20:32:48 Europe/Berlin] PHP   1. default_exception_handler($ex = *uninitialized*) C:\xampp5.6.11\htdocs\lms-hcos\lib\setuplib.php:0

Average of ratings: -
In reply to Neil Haskins

Re: "Unknown error" when duplicating activity

by Neil Haskins -

I was able to resolve this by setting "innodb_strict_mode = OFF" in my MariaDB settings.

Average of ratings: Useful (1)
In reply to Neil Haskins

Re: "Unknown error" when duplicating activity

by Kodden Tech -

Thank you very much Neil! 

I was getting the same error to backup my course, and now its working. 

Best Regards!