Cache error when trying to upgrade Moodle

Cache error when trying to upgrade Moodle

by Sabrina DLS -
Number of replies: 4
Hello,


I have a site with Moodle 2.7 and I am trying to upgrade it to 3.1. The thing is, every time i try to do it I get an error. It seems like all files inside the cache folder are being deleted, and then Moodle cant find them.


I dont have much experience with Moodle so i dont exactly know whats going on and why these files are being deleted. I also tried to upgrade Moodle to 3.5 but it didnt work, I still get those errors.

Here are the errors:

Warning: require_once(/domain.com/moodle/cache/lib.php): failed to open stream: No such file or directory in /domain.com/moodle/lib/setup.php on line 606

Fatal error: require_once(): Failed opening required '/domain.com//moodle/cache/lib.php' (include_path='/domain.com//moodle/lib/pear:.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /domain.com/moodle/lib/setup.php on line 606

I am following these steps:

https://docs.moodle.org/35/en/Upgrading


Does anybody know why this could be happening?

Thanks.-

Average of ratings: -
In reply to Sabrina DLS

Re: Cache error when trying to upgrade Moodle

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

The most likely reason is that you have missing files (cache/lib.php). This is not the cache folder - it's the folder for the program files that operate the cache.  How did you upgrade the Moodle code (or what instructions did you follow)?

In reply to Howard Miller

Re: Cache error when trying to upgrade Moodle

by Sabrina DLS -

Hello,

Yes, those files are missing, but only after I try to do the upgrade.

The steps I followed are:

1) First I downloaded Moodle 3.1.

2) Then copied my config.php file, theme and Mods from my old site to the new one.

3) After that, when I access the site, Moodle asks me to run the upgrade and as soon as I do that, those files are deleted and I get an error 500.


When I check the error is because those files are missing. Even if i try to run it again with those files, they still get deleted, this happens every time I try to update.

For example, when I do git stauts, i can see that those files where deleted:


deleted:    cache/README.md

deleted:    cache/admin.php

deleted:    cache/disabledlib.php

deleted:    cache/forms.php

deleted:    cache/lib.php

deleted:    cache/locallib.php

deleted:    cache/renderer.php

deleted:    cache/testperformance.php

deleted:    cache/upgrade.txt



Thanks.-

In reply to Sabrina DLS

Re: Cache error when trying to upgrade Moodle

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

Doesn't make sense. Moodle doesn't delete its own code. 

In config.php are you *sure* that $CFG->datadir is pointing to your 'moodledata' folder and NOT to the Moodle program files? In any case, if your web server can delete the program files then the permissions on those files are much too permissive. 

In reply to Howard Miller

Re: Cache error when trying to upgrade Moodle

by Sabrina DLS -

Hello,

Thank you!! I re-checked my configuration and you were right, although I didnt have that variable setted I did have "$CFG->dataroot" and it was pointing to the wrong location.

Just in case it happens to anyone else, that variable I think should point to your moodledata folder. I dont know what the difference between $CFG->dataroot and  $CFG->datadir is, but as soon as i pointed  $CFG->dataroot to the right location i was able to upgrade Moodle.

Thanks again!!