Restored Course 'cache module information' error

Restored Course 'cache module information' error

by Abraham Ott -
Number of replies: 9
Hi, I'm new to Moodle. I'm trying to consolidate several courses we've set up into one course using the course backup and restore. Everything seems to have gone smoothly, except now after I restored the third course into the destination course the error message "Could not cache module information for course 'Your Course'!" appears at the top of the course. What's causing this, and how would I fix it?

I tried searching the forums for a solution, but I couldn't find anything.
Average of ratings: -
In reply to Abraham Ott

Re: Restored Course 'cache module information' error

by Abraham Ott -
Anyone? I've since learned that it only happens once I've restored 3 course backups into the consolidated course (total of 18 topics). These courses each restored into their own course doesn't seem to break anything.

What am I missing? In the code the error message seems associated with course.modinfo; in another post on the forums Someone said you could set course.modinfo to an empty string and it would get rebuilt. I tried that on one of my sandbox conglomerated courses I've been playing with that throws the error, in case it simply had a bad course.modinfo entry. No luck, the field stays empty, does not get rebuilt and now that course throws three "Could not cache module information..." errors.

Anyone have any ideas?
In reply to Abraham Ott

Re: Restored Course 'cache module information' error

by Alissa Parrish -


We are experiencing the same problem with a course that we restored from multiple backups.  Any help would be appreciated.

Thanks.

In reply to Alissa Parrish

Re: Restored Course 'cache module information' error

by John Lohr -

I did finally find the solution.  The problem was due to the "modinfo" field in the Course table becoming too large.

While the data type for this field was set to “longtext”, which can hold over 4 trillion characters, the SQL select statement used to update this field was too long.  By default, MySQL limits packets received from clients to 1MB (1,048,576 characters).  After increasing this limit to 16MB, the issue is no longer a problem… and provided we don’t exceed the 16MB limit should not occur in the future.

SOLUTION:

In the ..\mysql\bin\my.cnf file:

Change

max_allowed_packet = 1M

to

max_allowed_packet = 16M

In reply to John Lohr

Re: Restored Course 'cache module information' error

by Jackie Toth -

I tried the solution above - increasing max_allowed_packet = 20M and it didn't help.  Any other ideas?  Did you have to do anything after increasing the parameter?

In reply to Jackie Toth

Re: Restored Course 'cache module information' error

by Daniel Kaelin -

I'm running into an identical problem in Moodle 1.9 and my max_allowed_packet is set to 64M. 

I haven't found a fix as of yet.

In reply to Daniel Kaelin

Re: Restored Course 'cache module information' error

by Lawrence N -

Jackie and Daniel,

which versions and build of Moodle do you have?

What platform (Unix/Linux/Windows/Mac) and database are you on?

What is your PHP version?

 

In reply to Lawrence N

Re: Restored Course 'cache module information' error

by Jackie Toth -

Lawrence,

Moodle 1.9.16 build 20120125

Linux

PHP 5.3.10

 

In reply to Jackie Toth

Re: Restored Course 'cache module information' error

by Heather Williams -

Jackie, for your situation the issue is from the version of studymate that is installed on the site. It looks like it has a bug and does not escape the ' character correctly. So when the query for updating modinfo was being run, there was a syntax error. Removing that character from the two studymate description fields in that course solves the error. 

Hopefully this has been resolved in a later release.

The debugging looked like:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'll keep loading them week by week. Sorry this one is late... ";s:4:"name";s:21:"' at line 1 (followed by huge query to update modinfo field)

Not sure if this helps anyone else, but I thought I'd post it just in case.

In reply to Lawrence N

Re: Restored Course 'cache module information' error

by Daniel Kaelin -

I am running Moodle 1.9.10 on a Unix / CENTOS 6 platform. 

The PHP version is 5.3.2. 

Mine seems to be triggered by adding big blue button rooms to the course but it isn't affecting every course that has rooms in it. 

I'm going to try bumping the max allowed packet size a lot higher and see if that addresses the issue. I'll post back here with the outcome.