@Nidhi ...
In a previous post you shared a query:
select * from `mdl_files` where `contenthash` like "0d74d5947507bca548de06af166f8513fa3a0048"
And that query found 10 references in the DB? Are those the records you deleted?
In a similar situation, I selected contenthash,filename,filesize from ... blah, blah. That way I knew if the file was a mimetype different from what was expected. There could be more than one file in filedir/0d/74/
Assume you deleted those references in the DB (your query above). I should have warned that since DB is out of sync with what's really in filedir, removing the reference from the DB should be done only when/if it's verified that there is no other file in that filedir/xx/yy/ directory.
So I'd do the query and then from ssh via command line:
cd /pathtomoodledata/filedir/
cd od/74/
and then I'd look to see what file (if any) was there:
ls -l
IF I saw a 0d74d5947507bca548de06af166f8513fa3a0048 file there, I'd check out what it was:
file -b 0d74d5947507bca548de06af166f8513fa3a0048
that command returns the file type/mimetype.
Because I had done the DB query with the filename, I could copy the 0d74d5947507bca548de06af166f8513fa3a0048 file out to document root (on my server /var/www/hmtl/) and rename it at the same time:
cp 0d74d5947507bca548de06af166f8513fa3a0048 /var/www/html/imagefilename.jpg (or whatever the filename was in the DB).
I could then look at the file via browser (later would remove the file from /var/www/html/
So now you have images missing ... like I said ... and like the warning.txt file says in filedir ... be careful and really know what you are doing when messing with any of it.
So ... if you can see the same errors as before ... missing [dataroot]/filedir/xx/yy/xxyyanothercontenthash
then to get around this now, manually create a file that has nothing in it at that location:
cd [dataroot]/filedir/xx/yy/
touch xxyyanothercontenthash
That last command will create a contenthash file name that is 0 bytes in size.
Now you can go into Moodle UI and edit the link to the file. You are really editing the DB (again) while uploading the true image again to get the physical file into the sea of files contained in filedir matching what's in mdl_files.
You have to do that process for each errant reference ... one at a time. I would not do a global sort of delete of the records in the DB without manually checking each one of those contenthash named files.
Hope this helps and doesn't make matters worse.
'spirit of sharing', Ken