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

Maximum execution time exceeded when trying to create calendar events


    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 3.4, 3.4 regressions, 3.4.1
    • Calendar
    • None

      As an administrator, when I try to create a calendar event in the new calendar, the "New event" popup opens and tries to load the corresponding fragment in the background. However, after thirty seconds I see a (rather not self-explanatory) error message popup (see screenshot):

      The actual fragment never shows, because the maximum execution time has been exceeded:

      [Mon Mar 05 15:28:18.386286 2018] [php7:error] [pid 27527] [client x.x.x.x:45036] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in <...>/
      calendar/lib.php on line 2630, referer: https://<...>/calendar/view.php?view=month&time=1520259917

      The maximum execution time consistently fails in line 2630, which, in our current instance, is this one: https://github.com/moodle/moodle/blob/fa19d594446b8c004f5175fdaf0b828706811a2d/calendar/lib.php#L2630. In that line, all applicable groups for the current user are assembled, based on the $courses array. For me, as an administrator, that $courses array holds all courses. Therefore, (I assume,) line 2630 tries to put together an array containing every group in our system. Our system holds 23 139 groups (for 29 297 courses).

      However, this problem does not only extend to administrators. For testing purposes I impersonated a teacher who is enrolled in 49 courses, most of which make intensive use of groups. Her request succeeds, so the fragment is shown, but loading that fragment takes very long. Also, the network tab of my browser says that this fragment is 160 KB large.

      (Additionally, I am administrator and teacher at the same time, so for me it is really not possible (without workarounds) to create calendar entries for my own courses using the new form. Since the old calendar form is unavailable as a fallback I have decided to mark this as a regression. I hope that is fine for you!)

            Unassigned Unassigned
            jan.dagefoerde Jan Dageförde
            6 Vote for this issue
            7 Start watching this issue


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