Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

by Andrew Lian -
Number of replies: 4

Hello I want to transfer a course from my university's moodle 3.x site to my moodle 3.10 site. I have succesfully backed up the course I want to transfer. I have uploaded it correctly to the moodle 3.10 website.

When I try to restore the course, I get the following message: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!" I am runnning MariaDB 10.x and php 7.3.x under CentOS. I have a VPS with full root access.

I have tried to find solutions online but have not found any. The mysql permissions are all correct  (user has ALL permissions) and the problem occurs whether I try to restore using cli or the normal web interface. I have switched debug mode on but have no further information to add. The course is fairly large: 2.2GB in size.

Some insights into what to do would be truly appreciated.

Thank you

Andrew

Average of ratings: -
In reply to Andrew Lian

Re: Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

by Ken Task -
Picture of Particularly helpful Moodlers

Have you run Server Environment check on new server?   Any yellows/reds or DB related recommendations?

Have you check web server error logs?

Does the course backup contain any content using 3rd party plugins not yet installed in your new 3.10?

Uploading the .mbz ... you doing drag and drop upload of .mbz or uploading to a file system repo via FTP?   If uploading via FTP, was the xfer done in binary mode?

'SoS', Ken

In reply to Ken Task

Re: Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

by Andrew Lian -
Thank you very much Ken. Everything checks out. The problem is that it cannot write to the database. I just discovered that it created part of the course. I have successfully uploaded a smaller course. This one is 2.2GB. I have a feeling it has something to do with the size of the package. I wonder if I need to tweak a mysql variable of some kind.
cheers
andrew
In reply to Andrew Lian

Re: Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

by Ken Task -
Picture of Particularly helpful Moodlers
.... "created part of the course." and showed no error???!!!!

Had suggested before you check web server error logs ... do you see any 'MySQL has gone away' error lines for about the time you were restoring? If so, yes, a tweak to MySQL is needed ... probably max_allowed_packet.

For technical: https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html

Default value for max_allowed_packet is 4M ... make it 32M (guess).

Also, if backup contains a lot of files/resources, another tweak might need to be made in PHP ... max_input_vars ... 5000 (guess). IF you edit php.ini don't forget to restart apache service for the changes to PHP to take affect.

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

Re: Restore problem: "moodle Potential coding error - existing temptables found when disposing database. Must be dropped!"

by Andrew Lian -
Thank you very much Ken. I will check the logs again... Thanks too for the tweaking suggestions...