Memory usage XX% 0 - theme isn't loading

Memory usage XX% 0 - theme isn't loading

by James Hamilton -
Number of replies: 3

Hi Everyone

The issue is that no theme renders at all. I've moved servers, and cleared caches - still nada. This is Moodle 3.9.2 and looks like so:

screenshot of problem

The error started on the "old" server when a Teacher tried backing up a 13GB course, at this stage "Memory Usage: 36%" started appearing in the error output (this is why I've put the question in this forum). Since moving servers (with more memory and diskspace) clearing out all caches I can think to clear that little message persists. I feel like solving that error message will help, but don't have a clue on how to achieve that. Would appreciate any assistance.

Average of ratings: -
In reply to James Hamilton

Re: Memory usage XX% 0 - theme isn't loading

by Šimon Zajíček -
Hello James,
From my experience every moodle migration is pain in the neck...
First thing first, what exactly means moved servers means? Just changed the HW(VM), or you changed network, or domain, is there any proxy in the way?
For the "ugly visual", try devel mode in you browser (F12 in most), this usually happens when there is
a) mixed content (the css and JSON is loading from https link, and the "new" server uses only http and vice versa)
b) there is something wrong with some of the theme files - to test this try to log in and change the theme to any other you have)
c) clear your local browser cache and run crone.

For the Memory usage:
Again try browser devel mode, there is a possibility that there is some kind of internal loop, in the php (than try to find out in a log, increase or decrease php timeout or memory limit), or it can be DB lockup.

And 13GB course, what the hell can be that big? Is there a possibility that there was an error when you migrated this much content, or is there enough space on you server?

If you want you can PM me, this is way too interesting.
Simon
In reply to Šimon Zajíček

Re: Memory usage XX% 0 - theme isn't loading

by James Hamilton -
Thanks Simon for enthusiasm in figuring this one out. I'll certainly reach out to you in a short while. I'll report on the progress Simon and I make, or not.
In reply to James Hamilton

Re: Memory usage XX% 0 - theme isn't loading

by James Hamilton -
Well folks, the problem has been resolved. So, I thought I'd come share the shame I have for missing the obvious. The story:

  1. Teacher backs up massive course.
  2. Between the cache and the backup process the VM freaks out and the diskspace is very, very low.
  3. The error "must be fixed by a ... " appears and after clearing the cache the site these fails to load. Any theme.
  4. At the top of the page prints "Memory Usage XX%".
As in the original post I knew it was something to do with that line "Memory Usage XX%". So, after over a week of four devs and I trying to find the issue I was perusing config.php on a late Friday evening and found the pesky bugger. 



So, at some point in the freak out that line was injected into config.php. So there it is, the tiniest gremlin hiding in plain sight ruined the Friday before.  For those that come late this would have saved me hours:

grep -r --include=*.php "Memory usage: 36%" /var/www/html... 

Lesson learned: it's not always as complicated as you think.

Average of ratings: Useful (1)