FastCGI Timeout Error (Win2003 Server + Moodle 2.4)

FastCGI Timeout Error (Win2003 Server + Moodle 2.4)

by Jizu Sun -
Number of replies: 2

Hi, everyone! I've tried installing Moodle in Windows 2003 Server (IIS 6.0 + FastCGI) for 20+ times, and I am always struck with this  FastCGI Error ( See below for details).

 

I'm so frustrated that I eagerly beg anyone who knows a clue to help me exploring further into the incompatility with Moodle and IIS(FastCGI).

BTW, I've installed Moodle 2.x with XAMPP successfully serveral times before.

==========================================

FastCGI Error

The FastCGI Handler was unable to process the request.


Error Details:

  • The FastCGI process exceeded configured activity timeout
  • Error Number: 258 (0x80070102).
  • Error Description: µÈ´ýµÄ²Ù×÷¹ýʱ¡£

HTTP Error 500 - Server Error.
Internet Information Services (IIS)

=====================================

 

I've tried reconfigure the PHP.ini as follows:

====================================

max_execution_time = 30000

====================================

 

and in fcgiext.ini (located in C:\windows\system32\inetsvr)

====================================

  EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000

 ActivityTimeout=900000

  RequestTimeout= 900000

 InstanceMaxRequests=100000

====================================

and I restart IIS before I reinstall.

As you can see, the time I designated to those variables are far more than the defaults.

 

Also, after failing in installing moodle, when I visit the moodle site with the URL http://wenfa.whut.edu.cn/moodle, the moodle site throws the following error message:

===========================

Default exception handler: Could not find a top-level course! Debug: 
Error code: nosite
* line 464 of \lib\datalib.php: moodle_exception thrown
* line 670 of \lib\setup.php: call to get_site()
* line 27 of \config.php: call to require_once()
* line 31 of \index.php: call to require_once()

===========================

Average of ratings: -
In reply to Jizu Sun

Re: FastCGI Timeout Error (Win2003 Server + Moodle 2.4)

by Steve Kleine -

I have been fighting the same issue on Windows 2008 R2 for months without success, but IIS internals are a weak area on knowledge for me.

So far I've:

  • changed the Application Pool account to localSystem
  • Modified timeout for FastCGI (as you have)
  • Set up a scheduled Moodle application pool recycle every four hours (seemed to give more stability but not completely)
  • Got the cron job to run every two hours (seems to exacerbate the issue)
  • Turned on failed request tracing for FastCGI (all it shows is the timeout and no root cause preceding it)
  • Changed max_allowed_packet = 8M and max_connections in MySQL from 100 to 1024
  • Turned off buffering per http://stackoverflow.com/questions/7178514/php-flush-stopped-flushing-in-iis7-5

The good side effects have been minimal.

 

Our install was from Microsofts's Web Application installed and we're running Moodle v2.3.2

In reply to Jizu Sun

Re: FastCGI Timeout Error (Win2003 Server + Moodle 2.4)

by Steve Kleine -

Until we find a solution to this one, as long as you're not adverse to using 3rd party utilities I have a working script to restart the W3SVC service when a 500 error like this occurs. It's a kludge at best, but it works.

Download UNXUTILS from SourceForge (http://unxutils.sourceforge.net/)

Unzip to c:\UNXUTILS

Create a batch file called c:\Restart_Web_Services.cmd, thus:

net stop W3SVC & net start W3SVC

Create a batch file called Check_500_Error.bat, thus:

@echo off
REM Using TAIL, retrieve the last 20 lines from the IIS logs and check for 500 errors from Nagios
REM If those are found, reset W3SVC

cd c:\unxutils\usr\local\wbin\tail -n 20 C:\inetpub\logs\LogFiles\W3SVC1\u_ex%date:~12,2%%date:~4,2%%date:~7,2%.log | grep -q -i " 500 0 64" && c:\Restart_Web_Services.cmd

I set the script to run as a scheduled task every five minutes at highest privileges and it's been working for 24 hours now powering through the resets as needed.

Average of ratings: Useful (1)