I turned on debugging and when I try to upload a file in teacher role, (from the Admin Panel > files) I get the error message:
Error writing to database and then this:
Debug info: Duplicate entry '61dcfb04ea33e07f165472527b45623883bdeb45' for key 'mdl_file_pat_uix'<br /><br />INSERT INTO mdl_files (contextid,filearea,itemid,filepath,filename,timecreated,timemodified,mimetype,userid,filesize,contenthash,pathnamehash) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)<br />[array ( 0 => '11', 1 => 'course_content', 2 => '0', 3 => '/', 4 => 'Winter.jpg', 5 => 1258134058, 6 => 1258134058, 7 => 'image/jpeg', 8 => '3', 9 => 105542, 10 => 'ca6ec835bffff37e28896df424db5559012d48b6', 11 => '61dcfb04ea33e07f165472527b45623883bdeb45', )]
Stack trace:
- line 365 of \lib\dml\moodle_database.php: dml_write_exception thrown
- line 738 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 781 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
- line 638 of \lib\file\file_storage.php: call to mysqli_native_moodle_database->insert_record()
- line 331 of \lib\file\file_info_stored.php: call to file_storage->create_file_from_pathname()
- line 96 of \files\index.php: call to file_info_stored->create_file_from_pathname()
Elaine, what version are you using? Dongsheng can you check this?