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

            Mart Mangus created issue -
            Dan Poltawski made changes -
            Field Original Value New Value
            Link This issue has a non-specific relationship to MDL-17837 [ MDL-17837 ]
            Dan Poltawski made changes -
            Assignee moodle.com [ moodle.com ] Dan Poltawski [ poltawski ]
            Dan Poltawski made changes -
            Status Open [ 1 ] Waiting for integration review [ 10010 ]
            Pull from Repository git://git.luns.net.uk/moodle
            Fix Version/s 2.1.3 [ 11251 ]
            Pull 2.1 Branch MDL-29803
            Pull 2.1 Diff URL https://git.luns.net.uk/?p=moodle.git;a=commit;h=541a9978a8d3c4fe09d9b2d342e28fcacc97a410
            Eloy Lafuente (stronk7) made changes -
            Currently in integration Yes [ 10041 ]
            Eloy Lafuente (stronk7) made changes -
            Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
            Integrator stronk7
            Eloy Lafuente (stronk7) made changes -
            Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
            Affects Version/s 2.0.5 [ 10950 ]
            Affects Version/s 2.2 [ 10656 ]
            Fix Version/s 2.0.6 [ 11250 ]
            Rossiani Wijaya made changes -
            Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
            Tester rwijaya
            Rossiani Wijaya made changes -
            Status Testing in progress [ 10011 ] Tested [ 10006 ]
            Rossiani Wijaya made changes -
            Link This issue has a non-specific relationship to MDL-30212 [ MDL-30212 ]
            Eloy Lafuente (stronk7) made changes -
            Status Tested [ 10006 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]
            Currently in integration Yes [ 10041 ]
            Integration date 15/Nov/11

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: