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

Create token for web service admin screen out of memory error

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.1.4, 2.2.1
    • 2.1.2, 2.2, 2.3
    • Web Services
    • Apache
    • MySQL, PostgreSQL
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • /admin/settings.php?section=webservicetokens
    • 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

      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)?

            jerome Jérôme Mouneyrac
            jp76 Jason Platts
            Rossiani Wijaya Rossiani Wijaya
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.