I am trying to upgrade Moodle 2.7 to 3.1.But for some reason I can't. This is the error:
Coding error detected, it must be fixed by a programmer: The data source class does not exist.
Debug info:
Error code: codingerror
Stack trace:
line 498 of /cache/classes/definition.php: coding_exception thrown
line 515 of /cache/classes/helper.php: call to cache_definition::load()
line 480 of /cache/classes/helper.php: call to cache_helper::purge_store()
line 323 of /admin/index.php: call to cache_helper::purge_all()
What could be the problem of this?
You may have removed a file which was meant to be included when loading the cache definitions from any db/caches.php
. Grep those files for datasource
, that will help you identify where the problem is.
Another reason would be that the class cannot be found because the cache code runs before the autoloading definitions are set. That would be very surprising, but you can have a look at [moodledatafolder]/cache/core_component.php
to see if the class is in there, and its path exists.
I just had the exact same problem trying to update from version 2.8 to 3.1, I found the solution in this Moodle Tracker issue:
Removed the following directories (and let Moodle rebuild them), cache, lock, temp, trashdir, sessions, localcache, muc (and anything else that shouldn't have been in there). Obviously don't delete your files/filedir!
I leave the solution in case someone else has this problem.
cd /var/moodledata
rm -fr ./cache/ ./lock/ ./temp/ ./trashdir/ ./sessions/ ./localcache/ ./muc/