I tried searching the forums for a solution, but I couldn't find 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?
We are experiencing the same problem with a course that we restored from multiple backups. Any help would be appreciated.
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.
In the ..\mysql\bin\my.cnf file:
max_allowed_packet = 1M
max_allowed_packet = 16M
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?
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.
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?
Moodle 1.9.16 build 20120125
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.
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.