Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26580

Upgrading a 1.9.10+ site to 2.0.2+ site fails with a "Maximum execution time of 300 seconds exceeded error"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
    • Environment:
    • Database:
      Microsoft SQL
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      I'm running into a timeout problem when I upgrade a Moodle 1.9.10+ site to Moodle 2.0.2+ (Build: 20110221). The site is running under IIS 6 on Windows Server 2003 and MSSQL 2005. I started the Moodle upgrade and everything seemed to go ok. Then after about 25 minutes the Moodle upgrade screen displayed a message saying "Migrated course files" and "Migrated user icons". Each showed 100% as the result. Then the upgrade seemed to halt with no other messages.

      After about an hour I looked in the PHP Error log file (I've configured php.ini to write all errors to a log file: error_log = "C:\PHP\PHPErrors.log") and I saw the following error:

      [23-Feb-2011 07:50:11] PHP Fatal error: Maximum execution time of 300 seconds exceeded in D:\Moodle\lib\dml\sqlsrv_native_moodle_database.php on line 356

      Some research indicated that this is a PHP timeout problem so I increased the following PHP configuration settings to very high values:
      max_execution_time = 1800
      max_input_time = 1800
      session.gc_maxlifetime = 1800

      I also increased the following FastCGI configuration settings to very high values:

      ActivityTimeout=1800
      RequestTimeout=1800
      IdleTimeout=1800

      Then I edited the IIS metabase and increased the IIS CGITimeout value to a high value: CGITimeout="1800"

      After restarting the web server and restoring my 1.9.10 site I tried to run the Moodle 2.0.2+ upgrade again. Once again I got the "Maximum execution time of 300 seconds exceeded in D:\Moodle\lib\dml\sqlsrv_native_moodle_database.php on line 356" error.

      Despite making all the above PHP and IIS configuration changes the upgrade still crashing after 300 seconds. All the googling that I was able to do indicated that this timeout can be adjusted by increasing the PHP max_execution_time and max_input_time values, but this obviously hasn't worked for me.

      Line 356 in \lib\dml\sqlsrv_native_moodle_database.php contains the do_query() function with:

      $result = sqlsrv_query($this->sqlsrv, $sql);

      So, it looks like sqlsrv_query() is taking too long to complete and IIS (or PHP??) is timing out after 300 seconds instead of obeying the new ActivityTimeout and RequestTimeout PHP values that I've set.

      Is there someway that I can alter the do_query() function so that it can "ping" the web server to let it know that the script is still running and thus prevent the timeout?

        Gliffy Diagrams

          Issue Links

            Activity

            libertymoodle Luis de Vasconcelos created issue -
            stronk7 Eloy Lafuente (stronk7) made changes -
            Field Original Value New Value
            Labels triaged
            Fix Version/s STABLE backlog [ 10463 ]
            dougiamas Martin Dougiamas made changes -
            Fix Version/s STABLE Sprint 8 [ 10541 ]
            Fix Version/s STABLE backlog [ 10463 ]
            nebgor Aparup Banerjee made changes -
            Assignee moodle.com [ moodle.com ] Aparup Banerjee [ nebgor ]
            nebgor Aparup Banerjee made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            nebgor Aparup Banerjee made changes -
            Link This issue will be resolved by PULL-586 [ PULL-586 ]
            nebgor Aparup Banerjee made changes -
            Link This issue will be resolved by PULL-587 [ PULL-587 ]
            dougiamas Martin Dougiamas made changes -
            Fix Version/s STABLE Sprint 9 [ 10550 ]
            Fix Version/s STABLE Sprint 8 [ 10541 ]
            nebgor Aparup Banerjee made changes -
            Status In Progress [ 3 ] Ready for review [ 10010 ]
            Resolution Fixed [ 1 ]
            skodak Petr Skoda made changes -
            Resolution Fixed [ 1 ]
            Status Ready for review [ 10010 ] Reopened [ 4 ]
            nebgor Aparup Banerjee made changes -
            Link This issue will be resolved by PULL-651 [ PULL-651 ]
            nebgor Aparup Banerjee made changes -
            Link This issue will be resolved by PULL-652 [ PULL-652 ]
            nebgor Aparup Banerjee made changes -
            Status Reopened [ 4 ] Ready for review [ 10010 ]
            Resolution Fixed [ 1 ]
            nebgor Aparup Banerjee made changes -
            Link This issue has been marked as being related by MDL-27251 [ MDL-27251 ]
            dougiamas Martin Dougiamas made changes -
            Workflow MDL Workflow [ 68200 ] MDL Full Workflow [ 76462 ]
            nebgor Aparup Banerjee made changes -
            Status Waiting for review [ 10010 ] Closed [ 6 ]
            salvetore Michael de Raadt made changes -
            Link This issue has been marked as being related by MDL-30942 [ MDL-30942 ]
            stronk7 Eloy Lafuente (stronk7) made changes -
            Fix Version/s STABLE Sprint 9 [ 10550 ]
            poltawski Dan Poltawski made changes -
            Comment [ The group of an pathway spirit in many principle has received geometric mass stroke but still very it is also anti-social whether the part in similar medication oddly explains the retrieval of limited brother.
            adderall instant release http://www.surveyanalytics.com//userimages/sub-2/2007589/3153260/29851519/7787443-29851519-stopadd20.html
            Sally opens the blood to meet the sprinters and finds one of the small titration's abusers. ]

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: