Request Timeout when editing or creating users

Request Timeout when editing or creating users

by Miguel Fabo -
Number of replies: 12

Good afternoon, community! Sorry to bother you. We are running PHP 7.1, MySQL 5.6.43 and Moodle 3.2.3 (yes, we are scheduling a big upgrade when Moodle 4 is released). Everything worked perfect, but lately I notice that when I want to edit any data in a user's account (whatever, password, email, etc) the browser keeps loading with the wheel that turns, and then it shows me:

Request Timeout
This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

It happens both when editing and creating users, but the rest of the experience is normal. In the case of creating users, the strange thing is that the user is truly created, even when the request times out. 
These are some of the current values in php.ini:

max_execution_time 600
max_input_time -1
max_input_vars 1000000
memory_limit 512M
post_max_size 512M
session.gc_maxlifetime 1440
upload_max_filesize 512M

I activated the debugger in developer mode but it shows absolutely nothing. Chrome, on the other hand, only shows me the following:

[Deprecation] Synchronous yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:24174 

XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

send @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:24174

Y.io @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:24352

_onSubmit @ yui_combo.php?3.17.2/timers/timers.js&3.17.2/querystring-stringify/querystring-stringify.js&m/1614135183/editor_atto/editor/editor-debug.js&m/1614135183/editor_atto/menu/menu-debug.js&m/1614135183/editor_atto/plugin/plugin-debug.js&m/1614135183/atto_collapse/button/button-debug.js&m/1614135183/atto_title/button/button-debug.js&m/1614135183/atto_bold/button/button-debug.js&m/1614135183/atto_italic/button/button-debug.js&m/1614135183/atto_unorderedlist/button/button-debug.js&m/1614135183/atto_orderedlist/button/button-debug.js&m/1614135183/atto_link/button/button-debug.js&m/1614135183/atto_image/button/button-debug.js&m/1614135183/atto_media/button/button-debug.js&m/1614135183/atto_managefiles/button/button-debug.js&m/1614135183/atto_underline/button/button-debug.js&m/1614135183/atto_strike/button/button-debug.js&m/1614135183/atto_subscript/button/button-debug.js&m/1614135183/atto_superscript/button/button-debug.js&m/1614135183/atto_align/button/button-debug.js:1613

_notify @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13680

notify @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13709

_notify @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13372

_procSubs @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13498

fireSimple @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13465

_fire @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13447

fire @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:13416

cewrapper.fn @ yui_combo.php?rollup/3.17.2/yui-moodlesimple.js&rollup/1614135183/mcore-debug.js:20467


And finally it shows error 500 when the request times out. If anyone experienced something similar, I would appreciate any advice or suggestion in this regard. Thank you very much in advance!

Average of ratings: -
In reply to Miguel Fabo

Re: Request Timeout when editing or creating users

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Leave debugging on and check your web server error log. That Error 500 *must* be logged and should hopefully show some additional information.

I would *at least* consider upgrading to the final version of 3.2 (3.2.9) as that should be reasonably simple - you will need to do that anyway before you go the 4 (or you should).
In reply to Howard Miller

Re: Request Timeout when editing or creating users

by Miguel Fabo -
Hi Howard, thank you very much for your reply. I just upgraded to 3.2.9 as you suggested, but everything remains the same. The exact same error.
That said, I enabled debugging options in developer mode, but no information appears. It's like debugging doesn't work, so I added these lines to the end of the config.php file:

ini_set ('display_errors', 'on');
ini_set ('log_errors', 'on');
ini_set ('display_startup_errors', 'on');
ini_set ('error_reporting', E_ALL);


But nothing changed. I'm attaching a screenshot of the current configuration in cPanel, maybe I'm overlooking something:

PHP settings

In cPanel there's an error section, but there are only references to 2 missing files: robots.txt (which isn't correct) and 404.shtml (that's correct). There's also a long list of entries that are identical:

"GET /calendar/set.php?return=L2NhbGVuZGFyL3ZpZXcucGhwP3RpbWU9MTQ5Njk3NjkzNiZjb3Vyc2U9MQ%3D%3D&sesskey=pDoW1CVGAh&var=showcourses/7.0" compatible Mozillah / 1.10 "/ Mozotfsrob6 / var=showcourses/" /) "

I wanted to disable it by entering these lines in robots.txt:

User-agent: *
Disallow: /

But it seems to have no effect because the server keeps registering it. The logs don't show any other additional information, which is very rare because the request timeout error occurs consistently every time I want to edit or create users.
Finally, in the errors_log file found in the moodle directory, these references appear:

[03-Mar-2021 08:00:58 America/Argentina/Buenos_Aires] Default exception handler: Lo sentimos, el archivo solicitado no se encuentra Debug: 
Error code: filenotfound
* line 496 of /lib/setuplib.php: moodle_exception thrown
* line 1803 of /lib/filelib.php: call to print_error()
* line 1769 of /lib/outputlib.php: call to send_file_not_found()
* line 65 of /theme/essential/lib.php: call to theme_config->setting_file_serve()
* line 4694 of /lib/filelib.php: call to theme_essential_pluginfile()
* line 37 of /pluginfile.php: call to file_pluginfile()

[05-Mar-2021 03:30:21 America/Argentina/Buenos_Aires] Default exception handler: Lo sentimos, el archivo solicitado no se encuentra Debug: 
Error code: filenotfound
* line 496 of /lib/setuplib.php: moodle_exception thrown
* line 1803 of /lib/filelib.php: call to print_error()
* line 1769 of /lib/outputlib.php: call to send_file_not_found()
* line 65 of /theme/essential/lib.php: call to theme_config->setting_file_serve()
* line 4694 of /lib/filelib.php: call to theme_essential_pluginfile()
* line 37 of /pluginfile.php: call to file_pluginfile()

[05-Mar-2021 04:59:27 America/Argentina/Buenos_Aires] Default exception handler: Lo sentimos, el archivo solicitado no se encuentra Debug: 
Error code: filenotfound
* line 496 of /lib/setuplib.php: moodle_exception thrown
* line 1803 of /lib/filelib.php: call to print_error()
* line 1769 of /lib/outputlib.php: call to send_file_not_found()
* line 65 of /theme/essential/lib.php: call to theme_config->setting_file_serve()
* line 4694 of /lib/filelib.php: call to theme_essential_pluginfile()
* line 37 of /pluginfile.php: call to file_pluginfile()

[06-Mar-2021 13:34:15 America/Argentina/Buenos_Aires] Default exception handler: Excepción - Call to undefined method moodle_page::js_amd_inline() Debug: 
Error code: generalexceptionmessage
* line 57 of /lib/classes/output/mustache_javascript_helper.php: Error thrown
* line 75 of data/localcache/mustache/1615003279/essential/__Mustache_966e04c10a8bf70cb989cf142b5890cc.php: call to core\output\mustache_javascript_helper->help()
* line 22 of data/localcache/mustache/1615003279/essential/__Mustache_966e04c10a8bf70cb989cf142b5890cc.php: call to __Mustache_966e04c10a8bf70cb989cf142b5890cc->section69b40c62660563b0e20a603eecfcfe60()
* line 67 of /lib/mustache/src/Mustache/Template.php: call to __Mustache_966e04c10a8bf70cb989cf142b5890cc->renderInternal()
* line 172 of /lib/outputrenderers.php: call to Mustache_Template->render()
* line 4210 of /lib/outputrenderers.php: call to renderer_base->render_from_template()
* line 1539 of /lib/outputrequirementslib.php: call to core_renderer->render_skip_links()
* line 636 of /lib/outputrenderers.php: call to page_requirements_manager->get_top_of_body_code()
* line 54 of /theme/essential/layout/maintenance.php: call to core_renderer->standard_top_of_body_html()
* line 1110 of /lib/outputrenderers.php: call to include()
* line 1040 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
* line 1842 of /lib/setuplib.php: call to core_renderer->header()
* line 2959 of /lib/weblib.php: call to bootstrap_renderer->__call()
* line 55 of /index.php: call to print_maintenance_message()

[06-Mar-2021 14:03:49 America/Argentina/Buenos_Aires] Default exception handler: Site is being upgraded, please retry later. Debug: 
Error code: upgraderunning
* line 503 of /lib/setuplib.php: moodle_exception thrown
* line 679 of /lib/setup.php: call to print_error()
* line 27 of /config.php: call to require_once()
* line 30 of /pluginfile.php: call to require_once()


Thanks again for your feedback!

In reply to Miguel Fabo

Re: Request Timeout when editing or creating users

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is that "call to undefine method" error a one-off or is it repeatable? Is there nothing in that log after the upgrade. It's very strange not to catch the 500 error.

Having said that, I've never used cPanel so can't be much help with the specifics.
In reply to Howard Miller

Re: Request Timeout when editing or creating users

by Miguel Fabo -
Hi Howard, thanks again for your reply!
** Is that "call to undefine method" error a one-off or is it repeatable? // It was only logged once, on March 26.
** Is there nothing in that log after the upgrade. It's very strange not to catch the 500 error. // There's no reference to error 500. I contacted the tech support of the hosting, but they say that it's not their job to solve problems with moodle, but they didn't offer me any additional information either. I will tell my bosses that at the end of the year we change hosting and take the opportunity to make a full upgrade to Moodle 4.
** Having said that, I've never used cPanel so can't be much help with the specifics. // There's no problem, thank you very much for your replies and contribution.
In reply to Miguel Fabo

Re: Request Timeout when editing or creating users

by Ken Task -
Picture of Particularly helpful Moodlers

Am certain Howard would spot this ...

I see in error logs reference to display of the essential theme.

Please see:

https://moodle.org/plugins/theme_essential

Suggest adding to config.php file a line that forces theme to one that came stock with the version of Moodle you are running now.   Those are boost, clean, or more.

$CFG->theme="boost';

No need to restart web service or server after that line is added just access with browser and do whatever you were trying to do.

Error go away?  How about errors in web service logs?

MIght also consider purging the caches for moodle via the php script in admin/cli/ for purging since you are changing theme.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Request Timeout when editing or creating users

by Miguel Fabo -
My bosses tell me that their Moodle (v 3.2.3) is exactly the same for 3 and a half years, they only updated courses and so on. The theme was also always the same. On Howard's recommendation, I updated to Moodle 3.2.9 and also updated the theme Essential, but the error continues. It's rare that without having done anything on the platform this problem has appeared like this out of nowhere, after all these years.
I tried forcing Boost as you suggested and purging the caches through the script, and then tried to update a user, but the same error occurred so apparently the themes are not causing that error. The strange thing is that after checking, the changes in the users are always updated. But it's uncomfortable and takes time because the browser stays loading for a while until the error appears on the screen, and just in case we must always check if the changes were updated or not.

Anyway, it's discouraging. The only good thing is that on the side of the students there seem to be no problems whatsoever. At this time it's impossible for my bosses to update the platform because they offer courses in the health area and there's a lot of work due to the pandemic, but I will propose that at the end of the year we migrate everything to Moodle 4. Thank you very much Ken, for your time and your suggestions. Greetings from Buenos Aires!
In reply to Miguel Fabo

Re: Request Timeout when editing or creating users

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What is the browser you use? Did you try a different browser / different computer?
In reply to Visvanath Ratnaweera

Re: Request Timeout when editing or creating users

by Miguel Fabo -

  • Hi Visvanath, I've tried all the browsers that I have (Chrome, Mozilla Firefox, Edge and Internet Explorer), and the same error occurred in all of them. The good thing is that today the error resolved itself, I did everything the other members recommended, I never knew what happened, but luckily the error no longer occurs. Thank you very much anyway!
In reply to Miguel Fabo

Re: Request Timeout when editing or creating users

by Miguel Fabo -
Hi good people, I wanted to tell you that today the error fixed itself, unfortunately I never knew what was really causing it, but it no longer happens. Thank you all very much for your help, have a great day!
In reply to Miguel Fabo

Re: Request Timeout when editing or creating users [RESOLVED]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators

Pretty certain it had been the server cache. Looking back the debug traces had localcache/ a couple of times. What you should have done is to delete moodledata/cache/, localcache/, muc/ etc. on the command line.

Now too late to verify - may be the next time.
wink

In reply to Visvanath Ratnaweera

Re: Request Timeout when editing or creating users [RESOLVED]

by Miguel Fabo -
That's a very good point, I will save this post for the future. Thank you very much!