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

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

by Jonathan Davey -
Number of replies: 20

Hi, I'm struggling to get to the root of this problem.

I am using 3.1.6 version and can't upgrade or delete anything. I keep getting this message.

Can anyone help me?

Average of ratings: -
In reply to Jonathan Davey

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

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

First step is to enable Debugging (all the way to developer and tick the show errors option underneath).  Reproduce the error. Hopefully you will see extra messages. What are they? 

You might have to check your web server's error log.

Average of ratings: Useful (1)
In reply to Howard Miller

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

by Jonathan Davey -

Thank you very much. I now get this:

Debug info: 
Error code: codingerror
×Stack trace:
  • line 513 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 1621 of /lib/moodlelib.php: call to cache_helper::purge_all()
  • line 37 of /admin/purgecaches.php: call to purge_all_caches()

Not sure what to do.

Jonny

In reply to Jonathan Davey

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

by Rahul Rai -

Hi Jonathan

Please try after a clean cache in the moodledata folder.

If not working let me know. 

Average of ratings: Useful (1)
In reply to Rahul Rai

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

by Jonathan Davey -

Thank you very much.


Sorry, could you tell me how to get to the Moodledata folder?


Jonny

In reply to Jonathan Davey

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

by Ken Task -
Picture of Particularly helpful Moodlers

If you mean via Moodle Admin interface ... not possible.

Your debug indicates operating system is linux.   Below is description via ssh/command line.  If you do not use ssh/command line then use whatever tool you have to browse files and translate the commands into whatever buttons/tools you have in whatever you are using to browse files.

To locate the moodledata diretory, check the config.php file of your moodle code.

The line that shows the path (below is example):

$CFG->dataroot  = '/home/example/moodledata';

So via ssh:

cd /home/example/moodledata/

issue 'pwd' to verify location

issue 'ls' which list all files/folders in moodledata

There will be two caches to clear:

cd cache

rm -fR *   (this removes all files/folders in 'cache' directory)

It is safe to manually remove as the cache and localcache will be rebuilt as moodle is used.

You are located now in /home/example/moodledata/cache/

cd ../localcache/

You've moved up the tree one level and now in 'localcache'.

rm -fR * (as above ditto ... but in 'localcache'

There is no need to restart any service/moodle.   Just hit moodle site with browser.  Login.  It will appear to be slower because caches are being rebuilt as you navigate Moodle links.

NOTE: after resolving the issue, turn off debugging.

** Important: make sure you are in 'moodledata' AND NOT the code directory for Moodle.

'spirit of sharing', Ken


Average of ratings: Useful (2)
In reply to Ken Task

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

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

....more likely the muc directory but deleting the 'cache' directory as well will do no harm.

'muc' folder contains the configuration and I'm pretty sure that's what's gone wrong. It's pointing to resources that no longer exist. We've had a few reports of this recently. 

Average of ratings: Useful (2)
In reply to Howard Miller

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

by Jonathan Davey -

This is great. Is the 'much' folder in moodle site admin? or, hosting server. Or PHPadmin in host server?


In reply to Ken Task

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

by Jonathan Davey -

Thank you Ken, this is very useful. But, above my level of understanding. I kind of get it but would need someone more experienced to actually do it.

In reply to Jonathan Davey

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

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

Your moodledata folder is wherever $CFG->dataroot line points to in Moodle's config.php file (which is in the 'root' directory of your Moodle install). 

When you've found it, completely delete the 'muc' folder and see what happens. 

Obviously you'll need file level access to your server or hosting - or know someone that does.

Average of ratings: Useful (2)
In reply to Howard Miller

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

by Jonathan Davey -

Thanks, I have asked Krystal my hosts to do this. Is it dangerous?


In reply to Jonathan Davey

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

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

No. The directory is recreated with a default version of the contents. That's why it will (hopefully) fix your problem.

Average of ratings: Useful (2)
In reply to Howard Miller

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

by Jonathan Davey -

Hi Howard, I deleted the 'Muc' with help from Krystal. Then tried the upgrade to 3.2 again. Which said 'fine', 'Done'. Then when I navigated to my Moodle I got this:

Debug info: Unknown column 'bi.requiredbytheme' in 'field list'
SELECT
bi.id,
bp.id AS blockpositionid,
bi.blockname,
bi.parentcontextid,
bi.showinsubcontexts,
bi.pagetypepattern,
bi.requiredbytheme,
bi.subpagepattern,
bi.defaultregion,
bi.defaultweight,
COALESCE(bp.visible, 1) AS visible,
COALESCE(bp.region, bi.defaultregion) AS region,
COALESCE(bp.weight, bi.defaultweight) AS weight,
bi.configdata
, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance

FROM mb0_block_instances bi
JOIN mb0_block b ON bi.blockname = b.name
LEFT JOIN mb0_block_positions bp ON bp.blockinstanceid = bi.id
AND bp.contextid = ?
AND bp.pagetype = ?
AND bp.subpage = ?
LEFT JOIN mb0_context ctx ON (ctx.instanceid = bi.id AND ctx.contextlevel = ?)

WHERE
(bi.parentcontextid IN (?, ?) OR (bi.showinsubcontexts = 1 AND bi.parentcontextid = ?))
AND bi.pagetypepattern IN (?,?,?,?)
AND (bi.subpagepattern IS NULL OR bi.subpagepattern = ?)
AND (bp.visible = 1 OR bp.visible IS NULL)
AND b.visible = 1
AND ((bi.blockname IN (?,?) AND bi.requiredbytheme = 1) OR (bi.blockname NOT IN (?,?) AND bi.requiredbytheme = 0))

ORDER BY
COALESCE(bp.region, bi.defaultregion),
COALESCE(bp.weight, bi.defaultweight),
bi.id
[array (
0 => 3195,
1 => 'course-management',
2 => '',
3 => 80,
4 => 3195,
5 => 1,
6 => '1',
7 => 'course-management',
8 => 'course-management-*',
9 => 'course-*',
10 => '*',
11 => '',
12 => 'navigation',
13 => 'settings',
14 => 'navigation',
15 => 'settings',
)]
Error code: dmlreadexception
Stack trace: 
  • line 474 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1027 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 767 of /lib/blocklib.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 1527 of /lib/pagelib.php: call to block_manager->load_blocks()
  • line 960 of /lib/pagelib.php: call to moodle_page->starting_output()
  • line 1035 of /lib/outputrenderers.php: call to moodle_page->set_state()
  • line ? of unknownfile: call to core_renderer->header()
  • line 417 of /lib/outputrenderers.php: call to call_user_func_array()
  • line 468 of /course/management.php: call to plugin_renderer_base->__call()
  • line 468 of /course/management.php: call to core_course_management_renderer->header()

Then I did a reinstall from a back up of 3.1.6

Not sure how to progress.


Jonny


In reply to Jonathan Davey

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

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

Did you restore from a backup before trying the upgrade again? It's possible your database was partly upgraded and was corrupted. 

Average of ratings: Useful (1)
In reply to Howard Miller

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

by Jonathan Davey -

No, when I go to 'Upgrade' on 'Installation' it does a back up then upgrades independently.


When I navigated at the top of the other text I sent it said:


'Error reading from database'

In reply to Jonathan Davey

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

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

Is this one of those third-party upgrade scripts?

If it is, it's very difficult to comment (at moodle.org) didn't develop it. I know I keep saying this but don't use these installers/upgraders as we have no idea what they do and it's very hard to help you when they go wrong. 

I would observe though - are you saying this is restoring your site to the state it was in before it all went wrong and then upgrading? I highly doubt it sad

Average of ratings: Useful (1)
In reply to Howard Miller

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

by Jonathan Davey -

Hi,

It's the Moodle update, they just apply it for me. 

I have backed up before each attempt to upgrade and I have to go back to the one I did a couple of days ago before I attempted to Krystal - Installation - Upgrade Page

In reply to Jonathan Davey

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

by Jonathan Davey -

This is my notifications page. I have tried to instal from here but it's a maze.Moodle notifications page

In reply to Jonathan Davey

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

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The problem is probably with this installer.  Unfortunately we have no idea what these programs do to Moodle so it is impossible for us to help you trouble shoot.

At some point, for the long haul, you would be better to get rid of the installer and manually install Moodle.  There is a bit of a learning curve but it is worth it in the long run.

Average of ratings: Useful (1)
In reply to Emma Richardson

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

by Jonathan Davey -

Thanks, I need someone to take on sorting this immediate issue of upgrades out. Or, to take down my current version and reinstall the latest version. Do you know of anyone who can do this for me?

In reply to Jonathan Davey

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

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

I would speak to whoever provided that installer and ask them to sort it out for you.