moodle-format_flexsections icon indicating copy to clipboard operation
moodle-format_flexsections copied to clipboard

Moodle 4.5.2 importing courses cause "Error writing to database"

Open djxpace opened this issue 9 months ago • 1 comments

Importing courses in Moodle 4.5.2 will cause the following error

Debug info: Duplicate entry '13-4' for key 'mdl_lms_coursect_cousec_uix'
UPDATE mdl_lms_course_sections SET section = ? WHERE id=?
[array (
0 => 4,
1 => '292',
)]
Error code: dmlwriteexception

The error code "dmlwriteexception" described on moodle support page gives nothing in relation to my server settings as everything seems to be correctly set. Found on moodle forum same issue where people suggested to contact Marina, so here I am.

Since I can't find key 'mdl_lms_coursect_cousec_uix', I'm at the end of trying to fix anything broken.

Please help

djxpace avatar Mar 05 '25 03:03 djxpace

Hello! Do you have detailed reproduction instructions or a course backup that I can use to reproduce this problem? Do you have a backtrace of the error?

So far I was not able to reproduce it.

marinaglancy avatar May 10 '25 09:05 marinaglancy