2.6. upgarde DDL sql execution error

2.6. upgarde DDL sql execution error

by Moodle Admin -
Number of replies: 6
Hello dear Moodlers, I've been using the auto-attendance module/block in my 2.4.5 installation which I am now upgrading to 2.6.

After having gone through the plugins overview, I selected to install the missing (optional) plugins and their updates from within moodle instead of copying/pasting the folders in the mod, blocks folder etc. 

 I've upgraded the autoattend_mod with success and after that I upgraded the block_autoattend too where I got the following error: 

 DDL sql execution error 

 Debug info: Duplicate entry '596-8070' for key 'mdl_autostud_attstu_uix' 
CREATE UNIQUE INDEX mdl_autostud_attstu_uix ON mdl_autoattend_students (attsid, studentid) 
Error code: ddlexecuteerror 
Stack trace: 
line 449 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown 
line 833 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 819 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr() 
line 129 of /blocks/autoattend/db/upgrade.php: call to database_manager->add_index() 
line 878 of /lib/upgradelib.php: call to xmldb_block_autoattend_upgrade() 
line 420 of /lib/upgradelib.php: call to upgrade_plugins_blocks() 
line 1601 of /lib/upgradelib.php: call to upgrade_plugins() 
line 438 of /admin/index.php: call to upgrade_noncore() 

 Does anyone knows where it is being caused from and what is the workaround to this? Any response would be highly appreciated as I got stuck in the middle of the upgrade because of this error. 

 Thank you in advance!!
Average of ratings: -
In reply to Moodle Admin

Re: 2.6. upgarde DDL sql execution error

by Moodle Admin -

Hi friends,

Does anyone know how to get past these errors and go ahead with the upgrade? Are there any problems in upgrading to the newest version of the attendance module/block?

Would be very helpful if someone could help/share their experience.

Thanks in advance.

In reply to Moodle Admin

Re: 2.6. upgarde DDL sql execution error

by Fumikazu Iseki -
Picture of Plugin developers

Hi.

If you see "duplicate record" error message, when upgrade to 2.2.0 or over.

  1. Backup DB
  2. version of version.php is made into the present version (2014032700 or 2013100600 or earlier).
  3. Execute Repair of DB by autoattend block at any course.
  4. Return version of version.php to original version (2014051600 or later). And upgrade autoattend block.


In reply to Fumikazu Iseki

Re: 2.6. upgarde DDL sql execution error

by Moodle Admin -

Hi Fumikazu,

Thanks so much for your reply, it is encouraging when someone eventually replies to your post especially when it comes to the auto-attendance plugin.

Sorry but I don't quite understand what do you mean by saying "execute Repair of DB by autoattend block at any course". Where should I run this repair of DB and for what reason? Is there a problem in upgrading the module to a newer version? 

Thank you once again!

In reply to Fumikazu Iseki

Re: 2.6. upgarde DDL sql execution error

by Fumikazu Iseki -
Picture of Plugin developers

OK.

I will update the autoattend block soon for automatic BD repair.

Please use autoattend block v2.3.3

Thanks.

In reply to Fumikazu Iseki

Re: 2.6. upgarde DDL sql execution error

by Moodle Admin -

In our current installation, 2.4.5, we are using these versions:

Auto-attend mod  2013061501

Auto-attend block 2013070800

Should I upgrade Moodle to 2.6.3 without upgrading the auto-attendance mod/block until you update them both?

I'm asking because the version for the block is v2.3.3  (https://moodle.org/plugins/view.php?plugin=block_autoattend) as you mentioned, 

BUT the auto_attend activity is v2.3.2 (https://moodle.org/plugins/view.php?plugin=mod_autoattendmod

?

Thanks once again for your prompt reply, it's much appreciated!

In reply to Moodle Admin

Re: 2.6. upgarde DDL sql execution error

by Fumikazu Iseki -
Picture of Plugin developers

Hi

I simply updated the block to add automatic repair function.
The module is OK with v2.3.2.