turnitin / moodle-plagiarism_turnitinsim

7 stars 9 forks source link

failure of core_course\task\course_delete_modules adhoc task #163

Closed gmskema closed 2 months ago

gmskema commented 5 months ago

During the execution of the core_course\task\course_delete_modules adhoc task, there is a query to turnitinsim tables generating an error, which causes a failure of those kind of tasks:

Execute adhoc task: core_course\task\course_delete_modules Adhoc task id: 2384892 Adhoc task custom data: {"cms":[{"id":"1158324","course":"313035","module":"76","instance":"52864","section":"2516108","idnumber":"","added":"1617107835","score":"0","indent":"0","visible":"1","visibleoncoursepage":"1","visibleold":"1","groupmode":"0","groupingid":"0","completion":"1","completiongradeitemnumber":null,"completionview":"0","completionexpected":"0","completionpassgrade":"0","showdescription":"1","availability":null,"deletioninprogress":"1","downloadcontent":"1","lang":""}],"userid":"107358","realuserid":"107358"} ... started 10:30:12. Current memory use 53.2 MB. ... used 47 dbqueries ... used 0.21808815002441 seconds Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 1158324 could not be deleted. Error reading from database (Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '=' SELECT PTS.userid, PTS.turnitinid, PTS.status, PTS.identifier, PTS.itemid, PTS.type, PTS.submittedtime, PTS.togenerate, PTS.generationtime, PTS.overallscore, PTS.requestedtime, PTS.errormessage, F.contenthash FROM mdl_plagiarism_turnitinsim_sub PTS LEFT JOIN mdl_files F ON PTS.identifier = F.pathnamehash WHERE PTS.cm = ? [array ( 0 => '1158324', )]): /var/www/sites/k2v4ppr.skema.edu/releases/20240606093314/moodle/lib/dml/moodle_database.php(494) #0

The problem seems to come from: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='

gmskema commented 2 months ago

Hello, Issue resolved on our side by changing the "interclassement" of the table mdl_plagiarism_turnitinsim_sub to be consistent with the rest of our database. It seems to be sufficient and have no side-effects. We'll be vigilant over the coming days.