Data Source does not exist, moodle 2.3.11 to 2.4 or 2.7.20

Data Source does not exist, moodle 2.3.11 to 2.4 or 2.7.20

by Grant Bender -
Number of replies: 3

Hello, first time here:

I am currently trying to upgrade from 2.3 to 2.7.  when I try to got to moodle 2.4 I get an error of "Table 'course_format_options' does not exist".  I have tried making a table with the correct columns but that did not work.  I have since tried going from 2.3 to 2.7 and I am getting another error stating that the 'data source does not exist'.

upgrade to 2.4 error stack

* line 431 of /cache/classes/definition.php: coding_exception thrown

* line 466 of /cache/classes/helper.php: call to cache_definition::load()

* line 435 of /cache/classes/helper.php: call to cache_helper::purge_store()

* line 1508 of /lib/moodlelib.php: call to cache_helper::purge_all()

* line 1472 of /lib/upgradelib.php: call to purge_all_caches()

* line 153 of /admin/cli/upgrade.php: call to upgrade_core()


!!! Coding error detected, it must be fixed by a programmer: The data source class does not exist. !!!!!

Error code: codingerror !!!! Stack trace: 


* line 431 of /cache/classes/definition.php: coding_exception thrown

* line 466 of /cache/classes/helper.php: call to cache_definition::load()

* line 435 of /cache/classes/helper.php: call to cache_helper::purge_store()

* line 1508 of /lib/moodlelib.php: call to cache_helper::purge_all()

* line 1472 of /lib/upgradelib.php: call to purge_all_caches()

* line 153 of /admin/cli/upgrade.php: call to upgrade_core() !!


upgrade to 2.7 error stack

* line 498 of /cache/classes/definition.php: coding_exception thrown

* line 472 of /cache/classes/helper.php: call to cache_definition::load()

* line 437 of /cache/classes/helper.php: call to cache_helper::purge_store()

* line 164 of /admin/cli/upgrade.php: call to cache_helper::purge_all()

!!! Coding error detected, it must be fixed by a programmer: The data source class does not exist. !!!


I have php version 5.6 running on Ubuntu 16.04.  I have backed up the database and since deleted the fake table I made.  I have been trying to update from the command line since people say it is easier that way, and I am using Git to switch between the versions.  Any help would be greatly appreciated at this time.

Average of ratings: -
In reply to Grant Bender

Re: Data Source does not exist, moodle 2.3.11 to 2.4 or 2.7.20

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

That table was definitely new in 2.4 and should have been added by the upgrade process. The fact that it wasn't indicates that the upgrade failed somehow and you're unlikely to resolve the problem by manually creating the table or carrying on upgrading. 

There's no real reason not to go from 2.3 straight to 2.7 (it may have additional bug fixes too). 

What you should do is to restore the 2.3 database backup I hope you took, make sure 2.3 works properly, enable full Debugging and try again. Watch closely for errors - check your web server error log. 

Let us know how you get on.

Average of ratings: Useful (1)
In reply to Grant Bender

Re: Data Source does not exist, moodle 2.3.11 to 2.4 or 2.7.20

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon intrusion ... when you say 'am using Git to *switch* between versions' ... mind describing exactly what you are doing?    Git just acquires code.   Then there is the database changes after that.

So if a git update/upgrade fails, to 'roll' the site backwards, one should restore the old code directory and especially the sql dump of the database you made just prior to the upgrade attempt.   Manually remove moodledata/muc cache localcache before accessing via browser again.

You might want to look at:

https://tracker.moodle.org/browse/MDL-57936

While hyperjumping is possible, think I'd start at the 2.3.11 version and just do a git pull to see if that works (even if your version is the highest 2.3.    Backup .... code and sql dump ... then take the site to 2.4.highest via git to see how well that goes.

Also, am wondering about the DB user used and if that user has priv's enough to do what needs to be done.

mysql> show grants [moodledbuser];

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Grant Bender

Re: Data Source does not exist, moodle 2.3.11 to 2.4 or 2.7.20

by Grant Bender -

Thank you both for answering,

     I was able to get the site updated to the current stable build of 3.3.1.  I restored my moodledata, mySQL database, and moodle files to the backups I made of 2.2.  From there I used git to checkout the stable 2.3, and cli upgraded.  Once I had it upgraded I took backups of the three listed above.  From there I did a git checkout of the 2.4 branch and proceeded to do a cli upgrade.  That worked  and I was running around the office with joy.  I proceeded to do the same cycle of backing up, checking out, and upgrading until I got to the currently supported stable version.  I have since made the conversion for the database to full unicode support using this page. 

 https://docs.moodle.org/33/en/MySQL_full_unicode_support

I have tested the site and making the last few backups as I type this.  thank you again for your help.

-Grant