Files not appearing on Moodle Site

Files not appearing on Moodle Site

by Anna M -
Number of replies: 18

Moodle newbie here. I recently updated my organization's Moodle site and everything looked good for several days. However, yesterday I logged on and none of the uploaded content was viewable (images, Word docs and PDFs). Moreover, any content I upload is also not viewable.

I've been looking around my moodledata folder trying to figure out the problem and noticed that the directory specified in the config.php file was outside of the moodledata folder. I tried changing that and still no luck.

Any thoughts would be appreciated!

Thanks!


Average of ratings: -
In reply to Anna M

Re: Files not appearing on Moodle Site

by Francisco Gutierrez -

Hi Anna.

What you mean when you say that content "is not viewable"?

Files in course are not visible?  Are you getting an error?


Francisco.

In reply to Francisco Gutierrez

Re: Files not appearing on Moodle Site

by Anna M -

Hi Francisco,

When I click on the docs I get a "this webpage is not available", and it says mywebsite.moodle/pluginfile.php/890/mod_resource/content/1/Discussion%20Expectations.pdf might be temporarily down or it may have moved permanently to a new web address.

Thanks so much!

Anna

In reply to Anna M

Re: Files not appearing on Moodle Site

by Anna M -

Update, I am now getting this error message.


session_get_instance() is deprecated, use \core\session\manager instead
  • line 240 of /lib/deprecatedlib.php: call to debugging()
  • line 2428 of /lib/filelib.php: call to session_get_instance()
  • line 394 of /mod/resource/lib.php: call to send_stored_file()
  • line 4399 of /lib/filelib.php: call to resource_pluginfile()
  • line 38 of /pluginfile.php: call to file_pluginfile()
check_browser_version has been deprecated, please update your code to use core_useragent instead.
  • line 3860 of /lib/deprecatedlib.php: call to debugging()
  • line 2434 of /lib/filelib.php: call to check_browser_version()
  • line 394 of /mod/resource/lib.php: call to send_stored_file()
  • line 4399 of /lib/filelib.php: call to resource_pluginfile()
  • line 38 of /pluginfile.php: call to file_pluginfile()
check_browser_version has been deprecated, please update your code to use core_useragent instead.
  • line 3860 of /lib/deprecatedlib.php: call to debugging()
  • line 2439 of /lib/filelib.php: call to check_browser_version()
  • line 394 of /mod/resource/lib.php: call to send_stored_file()
  • line 4399 of /lib/filelib.php: call to resource_pluginfile()
  • line 38 of /pluginfile.php: call to file_pluginfile()

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2446

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2460

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2461

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2462

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2017

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2021

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2027

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2068

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2071

Warning: Cannot modify header information - headers already sent by (output started at /home/afterschool/www/www/moodle/lib/weblib.php:2920) in/home/afterschool/www/www/moodle/lib/filelib.php on line 2114

Fatal error: Call to undefined function readfile_allow_large() in /home/afterschool/www/www/moodle/lib/filestorage/stored_file.php on line 448



Any thoughts?

In reply to Anna M

Re: Files not appearing on Moodle Site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Telling us which version of Moodle would help? wink

My guess is that you have recently upgraded Moodle and messed it up. It rather looks as though you have two versions mixed together or something along those lines. Does this sound reasonable?

EDIT:
The answer here is probably to completely delete the Moodle *code* (not the data or uploaded files) and replace it with a new, clean copy downloaded from here (moodle.org). 

In reply to Howard Miller

Re: Files not appearing on Moodle Site

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Which versions did you update from and to? How did you actually update? 

In reply to Colin Fraser

Re: Files not appearing on Moodle Site

by Anna M -

Hi, thanks so much for responding. I updated from I believe 1.8.10 to 2.9.1.

That sounds plausible. Would you recommend just reinstalling?

In reply to Anna M

Re: Files not appearing on Moodle Site

by Matthew Orlando -

Did you follow the upgrade path from 1.8 -> 1.9 -> 2.2 -> 2.9.1?

In reply to Matthew Orlando

Re: Files not appearing on Moodle Site

by Anna M -

No.... is upgrading directly a problem from 1.8-> 2.9.1 a problem?

In reply to Anna M

Re: Files not appearing on Moodle Site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes - it's impossible. Moodle actually won't let you which is even better.

You need to go from 1.8 to 1.9.19 (the final 1.9 version). Then to 2.2 (you can't upgrade beyond 2.2) and finally to 2.9. 

If you have backups I would reload 1.8 and start again. It's very hard to know what state you must be in now but it won't be good. 

In reply to Howard Miller

Re: Files not appearing on Moodle Site

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Anna, as what Howard has said above, there is just no getting around the upgrade path and retaining your original courses. The problem for you now is that the upgrade you attempted was probably trying t make fundamental changes to the database, so it is likely that your database is damaged, but not destroyed. I wouldn't waste my time trying to fix it though. It is likely damaged to the point where it may be better to drop it completely, and restore an earlier backup. I don't know what damage, if any, has been done to your moodledata folder, hopefully none at all. If this is the case, restoring your database with the backup, will likely allow you to install the v1.9.19+ codebase and have it work in short order.

Copy the existing config.php file. Delete all the code out of the Moodle directory/folder and just copy the unzipped v1.9.19+ into it. Paste the config.php file in the same place it was, then run the Moodle. It should behave pretty much like a normal installation, but it won't ask for database location or root password and so on as it already has that in the config.php file.  When completed, the Notifications page should pop up and tell you what has changed. 

When done, and you are satisfied the Moodle is again running properly, check the version of PHP you are running, check the database, then come and have a look in Moodle.org for the specs on upgrading to the next version, v2.2. You may need to upgrade your environment substantially before you can successfully install v2.2. Everything follows from that, the same processes are involved, but there are substantial differences in almost every aspect of Moodle. 

Of course, if you are revamping your courses, then bottom line is just install the latest stable release, and using mostly the same techniques used in building v.18-1.9.+ courses, you can rebuild your entire Moodle. Up to you. Good luck.  

  



In reply to Colin Fraser

Re: Files not appearing on Moodle Site

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Ana

One thing you should know: The discussion above is on https://docs.moodle.org/en/Upgrading, where you move the full site to higher versions. But the jump 1.9 > 2.2 was so high that many have given up and chosen to either upgrade course-by-course through https://docs.moodle.org/en/Site_backup and https://docs.moodle.org/en/Site_restore or, as Colin explained, to rebuild the new site from scratch.
In reply to Colin Fraser

Re: Files not appearing on Moodle Site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Colin - I disagree. The OP *must* also restore the 'moodledata' files area. Otherwise she will almost certainly find herself with no files.

In reply to Howard Miller

Re: Files not appearing on Moodle Site

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well, possibly Howard, but v1.8? I seem to recall doing something to a database, well OK, wrecking it, but was able to reconstruct the database with a previous backup, and I can't recall any issue with the moodledata folder. This was in my first stirrings with Moodle, which, until v1.9, were still pretty awkward. I got through that period more by luck than better judgement. I couldn't explain it then, and still don't know for certain what I did, but I cannot ever recall having to do much with the moodledata folder outside of uploading large courses and other files directly into it, until v2.0. 

Having said that, Ana may already have a complete backup ready to restore anyway... we just do not have enough information to surmise much at all.  

In reply to Colin Fraser

Re: Files not appearing on Moodle Site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Ok. But unless I have missed something we now have no idea what version she has upgraded (even partially) to. Given that, only a complete restore would be good enough for me.

In reply to Howard Miller

Re: Files not appearing on Moodle Site

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Above she said, "I updated from I believe 1.8.10 to 2.9.1" so unless it was a typo and she meant 2.8.10, but there was no 2.8.10 though was there, so maybe 2.8.1....mmmm 

Doesn't matter I suspect she would not be getting those errors unless the original was v1.8 or v1.9.  The value of consistent upgrades. I know I get slack and only do mine once a year now, but the version leaps are not that great a year apart. 

Bottom line though is still that the database as is, is likely dead, the codebase is probably so badly mauled that it needs to be replaced, and hopefully the moodledata folder is still intact. I really do think that if that is so, restoring the database, via phpMyAdmin, then restoring the original code, or even upgrading to v1.9.19 and reusing the config.php file, should see the original course structure in place. 

Don't forget, the database wasn't as stringent in v1.x as it became in v2.x and there was a much greater reliance upon the moodledata folder than there is now. There was also considerably more relaxed linking between the two which made it easy to manipulate courses. From memory, if I couldn't upload a course due to size restrictions or something, I created the course using the correct name. Then manually uploaded the required materials into the subfolders created by Moodle for it. Oh there was a number of things that had to be done, and I may have had to copy and paste materials into pages created, made sure the links to images and external resources were correct. It wasn't without its own dramas, but it saved me time. 

A full restoration would be the ideal, but this is one way it could be done to get out of the immediate problem.     

For me, it is what happens next that is important. I would seriously suggest that Ana create a brand new v2.2 Moodle, as a test site before trying to update her production site. Restore some courses into that complete with user data. See what happens.  


Average of ratings: Useful (1)
In reply to Colin Fraser

Re: Files not appearing on Moodle Site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

IF the OP has successfully run an upgrade between 1.x and 2.x (doesn't make any difference exactly what) and IF the file storage are upgrade ran in whole or part then she cannot take her files area back to a 1.x version as they are not there any more. The way in which the database interacted with the files in 1.x vs. 2.x is completely irrelevant. The point is that IF the files have been converted (in whole or part) to the 2.x format then as far as 1.x is concerned they are gone. The folder structure and naming convention completely changed - the database is neither here  nor there. 

So, again, unless you know something I don't if she is restoring her 1.8 site then she *must* also restore the moodledata files to be sure the site is recovered correctly. No if, buts or arguments. Anything else is bad advice.

Sorry to be so bolshy smile 

In reply to Howard Miller

Re: Files not appearing on Moodle Site

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Depends how far the "upgrade" got wouldn't it?  And keep going, If I'm looking a little butch here, is because there is a lot of valuable information being given out Howard..smile