Intermittent issue with Moodle 3.0.3

Intermittent issue with Moodle 3.0.3

by Kim McGee -
Number of replies: 5

This issue started after our summer upgrade from 2.8.5 to 3.0.3.  Prior to 3.0.3 we have had excellent up time and few issues.

It started as 500 errors (just the generic, no additional info even when looking at it from the server).  A couple times the error referenced FastCGI (error below), and now it’s just a spinning white screen.  This is randomly occurring and I haven’t been able to intentionally reproduce it.  Recycling IIS or rebooting the server resolves it.  Moodle is on a server by itself.


Moodle 3.0.3 (Build: 20160314)

Windows server 2008 R2 (4 CPU, 8 GB RAM – CPU rarely above 20%)

IIS 7.5

PHP 5.5 (w/ FastCGI)  -- at time of upgrade, using PHP 5.4.4 – after first 500 errors, upgraded to 5.5

SQL 2008 R2

Using the Essential theme ( version 3.0.1.10 (Build: 2016010215))

No custom blocks

All plugins up-to-date

 

Moodle is in its own app pool using the Network Service Identity.  Network Service has access to the Moodle and PHP directories.  App pool is set to recycle every 60 minutes.

PHP settings:                  max_execution_time                900

                                           max_input_time                         900

                                           memory_limit                              1024M

                                           allow_url_fopen = On                  

                                           fastcgi.impersonate = 1

                                           fastcgi.logging = 0

 

FastCgi settings:            Instance Max Requests             10000

                                           Max Instances                              0

                                           Activity timeout                          700

                                           Request timeout                         900

 

IIS log entries for times when we received the 500 error sometimes show  …. 500 0 64, or ….500 0 258, or …. 500 0 995 errors  (as well as a couple other system error codes).


Event viewer logs – Application & System don’t provide any clues.


FastCgi Error Summary:

HTTP Error 500.0 - Internal Server Error

The FastCGI process has failed frequently recently.  Try the request again in a while

Detailed Error Information -

Module FastCgiModule

Notification ExecuteRequestHandler

Handler PHP55_via_FastCGI

Error Code 0x80004005

 

 PHP log:

We regularly have one error in the PHP log – this isn’t always logged during an occurrence though (file name changes with each entry)

PHP Warning:  fopen(\Moodledata/localcache\91119c82-8eca-4ece-9ca7-c599dded570d\fc28aa8a-5f87-429a-9db2-75505743d49f/): failed to open stream: No such file or directory in \moodle\lib\filelib.php on line 3438

We occasionally get this logged -- Default exception handler: Incorrect sesskey submitted, form not accepted! Debug:

Error code: invalidsesskey

* line 488 of \lib\setuplib.php: moodle_exception thrown

* line 37 of \course\format\topcoll\settopcollpref.php: call to print_error()

But, again, doesn’t correspond to the occurrences.


Once in a while there will be an entry for a failed manual backup.

 

I recently purged all caches.

 

Ideas? Suggestions?

Is upgrading to Moodle 3.0.6 the next step?


Thanks for the help.


Average of ratings: -
In reply to Kim McGee

Re: Intermittent issue with Moodle 3.0.3

by Ken Task -
Picture of Particularly helpful Moodlers

Like Howard ... not a clue ... but ... a question ... is your PHP a 32bit version or a 64bit version (assuming that the server and everything else is 64bit)?

Don't host on Windows but from what I have read/seen, one of the issues with running anything AMP stack on Windows had been PHP 32bit version where everything else was 64 bit.   Well, that is now a thing of the past ... available for Windows is a 7.0.x version of PHP which is true 64 bit version.   And you just happen to have a version of Moodle that has been tested/known to work with PHP 7 (min. 3.0.1).

Usman ... resident Windows expert ... should be along when he has a chance and am certain he'll ask the question about PHP so I've already done that.   Am sure he'll have other recommendations as well.

'spirit of sharing', Ken

In reply to Ken Task

Re: Intermittent issue with Moodle 3.0.3

by Kim McGee -

Thanks Howard & Ken.

Yes, using 32 bit  (5.5.38)  PHP version.

In reply to Kim McGee

Re: Intermittent issue with Moodle 3.0.3

by Usman Asar -
Picture of Plugin developers Picture of Testers

500 Errors are usually caused by PHP mis-configuration, have you tried changing PHP configuration file?

Have you installed PHP from WPI? --> looks like to me for the name mentioned "php55_via_fastcgi" is usually given by WPI installs.

Try this

Delete all the PHP and as well Module Mapping settings from IIS interface. Restart from scratch, also make sure you have both 32 and 64 bit versions of VC++ compiler installed. Download correct version (NTS - Non-Thread  Safe) and do the manual setup.

Also, make sure you're using correct version of MS-SQL php driver, not that it's performance is bad, but with PHP it's always recommended using MySQL/MariaDB, it also gives you freedom to move to Linux platform without a hitch should you need to in future.

if you can spare sometime, Do have a look at blog post HERE,  though is for IIS 8.5 on Server 2012 R2, but set up method remains the  same.



Average of ratings: Useful (1)
In reply to Usman Asar

Re: Intermittent issue with Moodle 3.0.3

by Kim McGee -
Thanks Usman.

We no longer get 500 errors; only white screen now.
 
We've noticed that just prior to the whitescreen, a 5013 event is logged in the system logs.  5013 is A process serving application pool 'moodle' exceeded time limits during shut down. The process id was '1632'.

The shutdown time limit for that app pool was 90 seconds and I increased it to 120 last week.  This morning was our first episode since upping that limit.

Any suggestions other than PHP?  (yes, I have made modifications to php.ini based on findings from other postings and from your video modified the opcache settings)   I worked through the manual php installation in our test site but haven't implemented in production.   What do you have against WPI?