Moodle 2.9.1 - Issue while editing a course

Moodle 2.9.1 - Issue while editing a course

by Brandon Jimenez -
Number of replies: 1
I want to edit the image currently associated with one of the courses on my site, however, when i go into the corresponding editing page i get the following error


Can not create file "288/user/draft/1542764/XXXXX.jpg"

More information about this error

Debug info: Duplicate entry 'da314b348a88aa37dbf2f5e1e28cb7e5c97f5bec' for key 'XXX_file_pat_uix'
INSERT INTO lan_lal_files (contenthash,pathnamehash,contextid,component,filearea,itemid,filepath,filename,userid,filesize,mimetype,status,source,author,license,timecreated,timemodified,sortorder,referencefileid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '84d9c98167e8c9940624765c8a25180a02d2ed64',
1 => 'da314b348a88aa37dbf2f5e1e28cb7e5c97f5bec',
2 => 288,
3 => 'user',
4 => 'draft',
5 => 1542764,
6 => '/',
7 => 'XXX.jpg',
8 => '162',
9 => '101921',
10 => 'image/jpeg',
11 => '0',
12 => 'XXXX.jpg',
13 => 'XXXX',
14 => 'allrightsreserved',
15 => '1440715551',
16 => '1440715612',
17 => '0',
18 => NULL,
)]
Error code: storedfilenotcreated
Stack trace: 
  • line 1050 of /lib/filestorage/file_storage.php: stored_file_creation_exception thrown
  • line 407 of /lib/filelib.php: call to file_storage->create_file_from_storedfile()
  • line 193 of /lib/filelib.php: call to file_prepare_draft_area()
  • line 114 of /course/edit.php: call to file_prepare_standard_editor()
I checked both on the DB and on the filedir 
84 > d9
and the file exists.However, when I tried searching for
file_pat_uix
I came up empty handed. I tried editing the records directly in the DB but none of that would fix the issue. 


Any suggestions???


THANKS!!

Average of ratings: -
In reply to Brandon Jimenez

Re: Moodle 2.9.1 - Issue while editing a course

by Brandon Jimenez -
Update: going through the code, it is raising a consistency error, as far as i can get
  • line 1050 of /lib/filestorage/file_storage.php: stored_file_creation_exception thrown

has these comments a couple of lines before

// note: referencefileid is copied from the original file so that
        // creating a new file from an existing alias creates new alias implicitly.
        // here we just check the database consistency.

But still haven't been able to fix the aforementioned issue....help anyone?