Hello,
I had a Moodle installation version 1.9.19.
I updated by going through the following update path 1.9.19 -> 2.1.10 -> 2.2.11 -> 2.8.12 -> 3.1.2.
As part of the upgrade I had to set the PHP option register_globals off which couldn't be done on the server I was hosted. So I asked my host for a solution and they moved me to another server.
Now, from time to me and my students are getting this error message and I don't know what's causing it, if it's something from Moodle itself, if it's a setting in cPanel or something from the host. Sometimes, it goes away with a simple refresh. But in one case, a student had to wait 30 minutes for the error to go away. Thank you for the help.