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

Create token for web service admin screen out of memory error

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2, 2.3
    • Fix Version/s: 2.1.4, 2.2.1
    • Component/s: Web Services
    • Labels:
    • Environment:
      Apache
    • Database:
      MySQL, PostgreSQL
    • Testing Instructions:
      Hide

      Go to: Site administration / Plugins / Web services / Manage tokens
      (/admin/settings.php?section=webservicetokens)

      Select Add link.

      Get an out of memory error instead of expected page content.

      There are 70,000 entries in the user table on my test system.

      Page error text:

      Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 74 bytes) in /lib/dml/pgsql_native_moodle_database.php on line 718 Call Stack: 0.0000 634560 1.

      {main}

      () /admin/webservice/tokens.php:0 1.2209 47867152 2. moodleform->moodleform() /admin/webservice/tokens.php:55 1.2238 47921560 3. web_service_token_form->definition() /lib/formslib.php:154 1.2262 48171944 4. pgsql_native_moodle_database->get_records_sql() /admin/webservice/forms.php:189

      Show
      Go to: Site administration / Plugins / Web services / Manage tokens (/admin/settings.php?section=webservicetokens) Select Add link. Get an out of memory error instead of expected page content. There are 70,000 entries in the user table on my test system. Page error text: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 74 bytes) in /lib/dml/pgsql_native_moodle_database.php on line 718 Call Stack: 0.0000 634560 1. {main} () /admin/webservice/tokens.php:0 1.2209 47867152 2. moodleform->moodleform() /admin/webservice/tokens.php:55 1.2238 47921560 3. web_service_token_form->definition() /lib/formslib.php:154 1.2262 48171944 4. pgsql_native_moodle_database->get_records_sql() /admin/webservice/forms.php:189
    • URL:
      /admin/settings.php?section=webservicetokens
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:

      Description

      When attempting to create a web service token for a user via the web services admin section an out of memory error causes page load to fail.

      Error is from admin/webservice/forms.php

      web_service_token_form class has a select on the entire user table to populate the user 'searchableselector'.

      We have 300,000 users in the user table... so selecting the entire table is causing an issue!

      Even selecting on a system with a few thousand users means searchableselector search on the token page becomes unusable.

      Is there any data (capability check?) that could be used to cut down on the number returned or an alternate means of selecting the user that doesn't involve loading all at once (like on admin/user/user_bulk.php)?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  3 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jan/12