Moodle
  1. Moodle
  2. MDL-29803

"Site administration ► Reports ► Logs" gives "Fatal error: Allowed memory size of 134217728 bytes exhausted"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.5, 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Course
    • Labels:
      None
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Going to site "Site administration ► Reports ► Logs" gives header and title "Choose which logs you want to see:" and below is empty.

      If error reporting in switched on, then PHP error occurs: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /home/moodle/public_html/lib/dml/mysqli_native_moodle_database.php on line 820

      Expected result is the logs page.

      Show
      Going to site "Site administration ► Reports ► Logs" gives header and title "Choose which logs you want to see:" and below is empty. If error reporting in switched on, then PHP error occurs: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /home/moodle/public_html/lib/dml/mysqli_native_moodle_database.php on line 820 Expected result is the logs page.
    • Workaround:
      Hide

      Adding limit to course/report/log/lib.php(353):

          $courseusers = get_enrolled_users($context, '', $selectedgroup, 'u.id, u.firstname, u.lastname, u.idnumber', 'lastname ASC, firstname ASC', 0, 10000);

      shows the page, but not all users.

      Is there a way to get the users list with less memory?

      Show
      Adding limit to course/report/log/lib.php(353): $courseusers = get_enrolled_users($context, '', $selectedgroup, 'u.id, u.firstname, u.lastname, u.idnumber', 'lastname ASC, firstname ASC', 0, 10000); shows the page, but not all users. Is there a way to get the users list with less memory?
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:

      Description

      Going to site "Site administration ► Reports ► Logs" runs out of memory on our Moodle installation.

      Our site:

      • PHP memory limit: 128M
      • ~ 75 000 rows in users table.

      Little debugging shows, that the problem is in:

      #0 /home/moodle/public_html/lib/accesslib.php(3259): mysqli_native_moodle_database->get_records_sql('SELECT u.id, u....', Array, 0, 0)
      #1 /home/moodle/public_html/course/report/log/lib.php(353): get_enrolled_users(Object(stdClass), '', 0, 'u.id, u.firstna...', 'lastname ASC, f...')
      #2 /home/moodle/public_html/course/report/log/index.php(157): print_log_selector_form(Object(stdClass), 0, '1318712400', '', '', '', 0, 0, 1, 'showashtml')
      #3 {main}

        Gliffy Diagrams

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: