Installation help

 
 
Picture of Andy Tang
Add/edit courses in Moodle 2.5 loads halfway
 

Dear community,

Recently I've been given the task to upgrade from our current Moodle 2.2.3 to Moodle 2.5+ (Build: 20130614) which I've managed to so successfully.

However, while testing the functionality of the newly upgrade Moodle 2.5+ in my test server, I noticed that the "Add/edit courses" link in the Site Administration > Courses is loading for very long time and then it just stops with the page loading halfway. The URL of this page that loads halfway is /course/manage.php which is new in version 2.5

Check attachment for the screenshot of the problem.

Anyone can advice on this ?


 
Average of ratings: -
Picture of Howard Miller
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Switch on Debugging all the way to Developer and try again. Any additional messages?

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Thanks for the reply. Shortly after creating this forum post, I stumbled upon the debugging mode.

After turning on debugging, there is an entry in the php errorlog indicating that there is a missing function in one of the plugin I've installed.

I'm now trying to get the updated plugin that is compatible with Moodle 2.5+ 

 
Average of ratings: -
Picture of Howard Miller
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

OK. Please copy/paste the full error if you are still stuck.

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Update:

I've uninstalled all 3rd party plugins and removed the code files from filesystem.

However, clicking on "Add/edit courses" now is forever loading (browser is in waiting state spinning circle) and it has been like this for more than an hour. 

There are no error in the php errorlog or the apache log.

There are about 500,000 (yes half a million) records in the table mdl_course_categories. Could this be a problem ?

When it was in 2.2.3, the "Add/edit courses" works but took a long time to generate the page.

 

 
Average of ratings: -
Picture of Howard Miller
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Seems a bit odd. Have you tried a different PC/Browser? No browser should sit there spinning for that long surely...

Do you actually have half a million course categories? That would be a lot of typing wink

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Hi,

The entries in mdl_course_categories are inserted automatically by our student management system integration script with Moodle. 

I've do a select count(*) from mdl_course_categories resulting in 488k records.

I've tested both Chrome and IE, both does not seem to respond with the browser still loading. Loading Moodle again in another new tab resulted in "Timed out while waiting for session lock."

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Hi,

Update:

This time I left the browser load until it shows "The page cannot be found".

I then checked the php errorlog and it shows these (Note that I've already set the execution timeout to 7200):

[26-Jun-2013 10:54:46 UTC] PHP Fatal error: Out of memory (allocated 847249408) (tried to allocate 524379 bytes) in F:\Apache2.2\htdocs\moodle\cache\classes\loaders.php on line 515
[26-Jun-2013 11:10:32 UTC] PHP Fatal error: Maximum execution time of 7200 seconds exceeded in F:\Apache2.2\htdocs\moodle\lib\dml\moodle_database.php on line 376

 
Average of ratings: -
Picture of Ken Task
Re: Add/edit courses in Moodle 2.5 loads halfway
Group Particularly helpful Moodlers

Think first error bgat the second.  Wow! 847249408 is 808 M but whatever Moodle is trying to do it needs .5 Meg more ... the  524379 bytes.  So, if you're not pushing the server into a state of total confusion, increase the 808M to 810M ... or 849346560 bytes.

In your php.ini variables for amounts of memory ... are you using bytes or an M designator?  Reason I ask, had similar issues, until I started using bytes only in php.ini.  Yeah, I know it's supposed to work with M designators, but ....

Anything running that you do without on the server?  Kill off what you don't need.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Andrew Nicols
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Andy,

Just to confirm, did you applied the patch in MDL-40130 yet, and do you still see the out of memory error with it applied?

Here is the MDL_PERF output for our testing site, running 2.5 with no patches applied. We have 471 course categories, also inserted (using the correct API functions) by our custom enrol plugin linked against our MIS. Our maximum course category depth is five.

[Thu Jun 27 08:15:41 2013] [error] [client 10.32.18.50] PERF: /25/course/manage.php time: 131.309689s memory_total: 48033848B (45.8MB) memory_growth: 47686392B (45.5MB) memory_peak: 68457936B (65.3MB) includecount: 409 contextswithfilters: 1 filterscreated: 7 textsfiltered: 1 stringsfiltered: 0 langcountgetstring: 2437 includedyuimodules: 0 includedjsmodules: 2 db reads/writes: 1480/1 ticks: 13132 user: 10107 sys: 1469 cuser: 0 csys: 0 serverload: 0.99 Session: 54.4KB Caches used (hits/misses/sets): core/config {** static persist **(1/22/0) cachestore_memcached(22/0/0) } core/databasemeta {** static persist **(926/14/0) cachestore_memcached(14/0/0) } core/string {** static persist **(3446/397/0) cachestore_memcached(397/0/0) } core/pluginlist {** static persist **(19/42/0) cachestore_memcached(42/0/0) } core/plugintypes {** static persist **(999/2/0) cachestore_memcached(2/0/0) } core/yuimodules {cachestore_memcached(1/0/0) } core/plugininfo_base {** static persist **(1017/2/0) cachestore_memcached(2/0/0) } core/plugininfo_mod {** static persist **(84/1/0) cachestore_memcached(1/0/0) } core/plugininfo_block {** static persist **(63/1/0) cachestore_memcached(1/0/0) } core/plugininfo_filter {** static persist **(6/1/0) cachestore_memcached(1/0/0) } core/plugininfo_repository {** static persist **(20/1/0) cachestore_memcached(1/0/0) } core/repositories {** static persist **(0/13/0) cachestore_static(0/13/24) } core/coursecat {cachestore_file(1/0/944) **static session**(944/0/943) } core/eventinvalidation {** static persist **(0/2/0) } .

As a comparison, here is the same output with MDL-40130:

[Thu Jun 27 08:10:58 2013] [error] [client 10.32.18.50] PERF: /25/course/manage.php time: 48.567338s memory_total: 48461736B (46.2MB) memory_growth: 48114280B (45.9MB) memory_peak: 68884416B (65.7MB) includecount: 409 contextswithfilters: 1 filterscreated: 7 textsfiltered: 1 stringsfiltered: 0 langcountgetstring: 2437 includedyuimodules: 0 includedjsmodules: 2 db reads/writes: 600/0 ticks: 4857 user: 2352 sys: 473 cuser: 0 csys: 0 serverload: 0.56 Session: 54.4KB Caches used (hits/misses/sets): core/config {** static persist **(1/22/0) cachestore_memcached(22/0/0) } core/databasemeta {** static persist **(475/14/0) cachestore_memcached(14/0/0) } core/string {** static persist **(3446/397/0) cachestore_memcached(397/0/0) } core/pluginlist {** static persist **(19/42/0) cachestore_memcached(42/0/0) } core/plugintypes {** static persist **(999/2/0) cachestore_memcached(2/0/0) } core/yuimodules {cachestore_memcached(1/0/0) } core/plugininfo_base {** static persist **(1017/2/0) cachestore_memcached(2/0/0) } core/plugininfo_mod {** static persist **(84/1/0) cachestore_memcached(1/0/0) } core/plugininfo_block {** static persist **(63/1/0) cachestore_memcached(1/0/0) } core/plugininfo_filter {** static persist **(6/1/0) cachestore_memcached(1/0/0) } core/plugininfo_repository {** static persist **(20/1/0) cachestore_memcached(1/0/0) } core/repositories {** static persist **(0/13/0) cachestore_static(0/13/24) } core/coursecat {cachestore_file(1/0/523) **static session**(943/521/522) } core/eventinvalidation {** static persist **(0/3/0) } core/coursecattree {** static persist **(0/522/0) cachestore_memcached(522/0/1) } .

And here's the same style output with MDL-40280 also applied:

[Thu Jun 27 08:12:50 2013] [error] [client 10.32.18.50] PERF: /25/course/manage.php time: 20.871029s memory_total: 48107752B (45.9MB) memory_growth: 47760304B (45.5MB) memory_peak: 68528576B (65.4MB) includecount: 409 contextswithfilters: 1 filterscreated: 7 textsfiltered: 1 stringsfiltered: 0 langcountgetstring: 2437 includedyuimodules: 0 includedjsmodules: 2 db reads/writes: 559/0 ticks: 2087 user: 1416 sys: 411 cuser: 0 csys: 0 serverload: 0.50 Session: 54.4KB Caches used (hits/misses/sets): core/config {** static persist **(1/22/0) cachestore_memcached(22/0/0) } core/databasemeta {** static persist **(475/14/0) cachestore_memcached(14/0/0) } core/string {** static persist **(3446/397/0) cachestore_memcached(397/0/0) } core/pluginlist {** static persist **(19/42/0) cachestore_memcached(42/0/0) } core/plugintypes {** static persist **(999/2/0) cachestore_memcached(2/0/0) } core/yuimodules {cachestore_memcached(1/0/0) } core/plugininfo_base {** static persist **(1017/2/0) cachestore_memcached(2/0/0) } core/plugininfo_mod {** static persist **(84/1/0) cachestore_memcached(1/0/0) } core/plugininfo_block {** static persist **(63/1/0) cachestore_memcached(1/0/0) } core/plugininfo_filter {** static persist **(6/1/0) cachestore_memcached(1/0/0) } core/plugininfo_repository {** static persist **(20/1/0) cachestore_memcached(1/0/0) } core/repositories {** static persist **(0/13/0) cachestore_static(0/13/24) } core/coursecat {cachestore_file(1/0/3) **static session**(1414/1/2) } core/eventinvalidation {** static persist **(0/2/0) } .

As you can see, the memory usage is pretty reasonable for both (65MB peak is pretty reasonable IMO).

Things to note about these results:

  • we have got a memcached MUC store set up, however the coursecat MUC cache used by this part of coursecat does not used the memcached store (it's a session cache);
  • we have php5-apc installed and configured appropriately
  • this is against a postgres database (reasonably well tuned for a testing system)
  • this is a testing system and under no real load

Andrew

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Apologies for a mistake here, mdl_course_categories have 3.5k records not 488k records.

The table that has 488k records is mdl_context

 
Average of ratings: -
Me
Re: Add/edit courses in Moodle 2.5 loads halfway
 
Howard,
 
The error message in the dialog box was
Invalid JSON string
In the file picker box this text appeared.
Invalid JSON string<pre> Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, shermankeene@yahoo.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache Server at shermankeene.com Port 443 </pre>
I couldn't find the error log files on the new Parallels server system at Website Source.
 
Regards,
Sherman Keene
 
Average of ratings: -
Picture of Howard Miller
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

You're probably going to need to find that log. Can you ask your support people?

 
Average of ratings: -
Picture of Fiona MacAlister
Re: Add/edit courses in Moodle 2.5 loads halfway
 

I am experiencing a similar problem after upgrading from 2.3.3 to 2.5+ (Build: 20130530).  The add/edit course page loads but when I click on a category I get the following error:

Moodle 2.5

If I try to click on one of the subcategories shown there is no listing of course pages and it continues to produce the same error.  The subcategory and all of its courses do display in the navigation block and are linkable from there. I thought, at first, that it could possibly be something to do with the theme but I switched back to the Standard theme and it did exactly the same thing. How does one go about fixing this?

 
Average of ratings: -
Picture of Fiona MacAlister
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Is there any chance that someone could  respond to my post above, which I feel is very likely related to the problem that Andy is experiencing. That is why I posted it in this thread.  I wasn't trying to hijack Andy's thread. Having received no response on this thread, I decided to post it to the General thread but it seems to have been removed from there .... It was not an attempt at cross posting. I posted it there because it seemed that I was not going to receive a response here. Help, from anyone, would be appreciated.

 
Average of ratings: -
Picture of Marina Glancy
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Moodle HQGroup Particularly helpful Moodlers

Fiona, please check if you have correctly set 'coursesperpage'. Otherwise feel free to report an issue in tracker

 
Average of ratings: -
Picture of Fiona MacAlister
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Hi Marina

Thank you so much for this. Yes, that was the issue. The setting was at 0. I didn't realise that this would have an effect on the listing of courses on the admin side. We don't list courses on the front page as our Moodle is not 'open'. Would never have found this without your help. Much appreciated. smile

 
Average of ratings: -
Picture of Andrew Nicols
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Even then, I feel that this is a bug. No matter what the setting, we shouldn't be throwing exceptions like that.

 
Average of ratings: -
Picture of Andrew Nicols
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi,

/course/manage.php (introduced in Moodle 2.5) has hit some performance issues which I've been working to debug.

One of them is fixed in MDL-40130 - essentially, the cache was not being correctly used. This should be available in Moodle 2.5.1 or you can apply the three-line patch sooner if you wish.

I've also been working on MDL-40280 which should hopefully improve performance further. For us, this reduces the page load time from 123 seconds to 23 seconds so clearly further work is still required.

Andrew

 
Average of ratings:Useful (2)
Picture of Marina Glancy
Re: Add/edit courses in Moodle 2.5 loads halfway
Group DevelopersGroup Moodle HQGroup Particularly helpful Moodlers

Andy and everybody who experienced problems with "add/edit course" page. Please update your Moodle to the weekly version released today (Moodle 2.5+): http://download.moodle.org/

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Hi, I've updated to the latest 2.5+ (20130627)

The page still loads halfway and there is an error thrown in the php errorlog:

[28-Jun-2013 03:19:11 UTC] PHP Fatal error: Out of memory (allocated 1766850560) (tried to allocate 524379 bytes) in F:\Apache2.2\htdocs\moodle\cache\classes\loaders.php on line 515

The memory footprint is still so large due to our 3512 course categories

At least this time I dont need to wait for 2 hours (7200 php max execution timeout) for the script to fail.

 
Average of ratings: -
Picture of Andy Tang
Re: Add/edit courses in Moodle 2.5 loads halfway
 

Hi, its been more than a week. Any updates so far on this issue ?

 
Average of ratings: -