Cannot read file. Either the file does not exist or there is a permission problem.

Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
Number of replies: 8

dear Moodle expert;

I have updated from Moodle 3.9 to latest version of Moodle 3.9 till feb 20th 2021. But once i have upgraded the version of php 7.1 to 7.2 then I found that most of the files are not downloding and shows me error about either the file does not exist or there is a permission problem.

please help me what i will do to get or download the files safely.

Average of ratings: -
In reply to Abu Ali

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Your Moodle 3.9 site was running with PHP 7.1? How did you upgrade to 3.9? Because Moodle 3.9 needs min. PHP 7.2. Ref. https://docs.moodle.org/dev/Moodle_3.9_release_notes#Server_requirements

Saw that in October you were running Moodle 3.7 https://moodle.org/mod/forum/discuss.php?d=411464. For that PHP 7.1 is correct. You must have upgraded Moodle without upgrading PHP.

BTW, what was the issue in the discussion https://moodle.org/mod/forum/discuss.php?d=411464 ? It would be nice, if you could close the issue with a note on the resolution.
In reply to Visvanath Ratnaweera

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
i think , i was using 3.9 earlier version that is the reason . Dear please help me to get the rid from this error. i am not able to get my files. only empty files are downloading. i have tried to get the help from blue host becoase i got the hosting from blue host but they are telling there is no any problem in their end.
In reply to Abu Ali

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
No, the release notes (linked earlier) say PHP 7.2 is needed since 3.9.0. If your hosting provider stall ran Moodle 3.9 on PHP 7.1, that means they heavily hack in to Moodle. Then they should continue, the advice for stock Moodle is not valid. BTW, in the other discussion linked earlier, I understood that the server is "fully mananged". Then that is what it is.

That said, the current symptom is not clear to me. "most of the files are not downloding and shows me error about either the file does not exist or there is a permission problem" What files do you download? What is the error message exactly? A screen-shot is needed. What does https://docs.moodle.org/39/en/Debugging have to say more?

Edit: Saw this: https://moodle.org/mod/forum/discuss.php?d=418852. Is it the same problem? If so, please keep on posting the same question, you can "ping" if no replies are coming.

Also, close resolved discussions, I can see that you have had a stream of issues. If none of them were resolved, then they could be connected.



In reply to Visvanath Ratnaweera

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
Thanks dear for giving me reply...

Actually moodle is not display any error but the files are showing empty files. it is not displaying any contents in the file. when i used to open the file in edit mode then it shows the file can not read, either the file does not exist or there is a permission problem
In reply to Visvanath Ratnaweera

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
i am talking about those file who has been uploaded into the courses. course material files are downloading but there is no contents inside the file. it is happen after changing the php 7.1 to php 7.2
In reply to Abu Ali

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
So you have a https://docs.moodle.org/39/en/File_resource in a course which has been uploaded there as explained in the second video in that page. Now you as administrator go to the course, put it to edit mode, go to "Edit settings" of that file resource, click on the file and then select Download. The browser downloads a file. But that file is of zero size. Correct?

But when the course is not in edit mode, you can click on the file and it opens as expected?

Never come across a situation like that. Who do the upgrades, I mean Moodle and PHP? They should know what they've done, and tested the result of their work. Did you read my previous post https://moodle.org/mod/forum/discuss.php?d=419162#p1689194 ? What about all the questions I asked. Sorry, I can't answer my own questions, as a result can't help you.
In reply to Visvanath Ratnaweera

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
actually scenario is that in the main folder that is public_html, i have run one moodle for undergraduate students, in the same folder i have created my ownfolder for mba and i have put another moodle inside that folder.
now in this case there are two moodle instance are running one is for undergraduate that are accessing directly typing the url of our site and other is that is mba are used to access the moodle by tying the main path \mba
i have updated undergraduate moodle from 3.9 early version to 3.9 but this time while installing the moodle the minimum requirement are asking about php7.2 then i have opened the whm that is dedicated from bluehost and i have updated php7.1 to 7.2 and after that i restart the server from the control panel otpion then i found that server is stuck and then i requested to agent of bluehost to restart the server and he took 5 to 10 minutes and restart the server. but after this my files are disturbed.
in the mba folder i have already installed moodle3.7 and it was running smoothly. but after this incident i find the same issue in the files.
as you mentioned goto the course and turnedit on and download the file. while i am select the file then it shows the size of the file like 42mb and so on but while downloading it never shows any contents with file. please find the images.

one more thing, if i will upload the file after this insicident then that file is accesible with the contents. but files uploaded this incident is not showing the contents as i have mentioned. please help me if you can
Attachment 111.PNG
In reply to Abu Ali

Re: Cannot read file. Either the file does not exist or there is a permission problem.

by Abu Ali -
waiting the help from any one.