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

coding_exception detected running 'Do a H5P attempt' behat feature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.8.6, 3.9.3
    • 3.9.2, 3.10, 4.0
    • Navigation
    • MOODLE_310_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • Hide
      1. Login as admin
      2. Switch to classic theme
      3. Create a new user
      4. Create a new course
      5. Enrol user as a student in course
      6. From the course participants page, click on the new user
      7. Press Reports > Today's logs
      8. Confirm you don't see the following exception in your webserver error logs:

        [php7:notice] [pid 32] [client 172.21.0.1:33918] Default exception handler: Coding error detected, it must be fixed by a programmer:
        Error: Can't find data record in database table course. (SELECT * FROM {course} WHERE id = ?\n[array (\n  0 => '0',\n)])
        Debug: \nError code: codingerror\n* line 120 of /lib/ajax/getnavbranch.php: coding_exception thrown\n, referer: http://localhost:8000/report/log/user.php?id=3&course=2&mode=today
        

      9. Confirm the navigation block shows the following nodes expanded
        • Dashboard > Courses > [Your course] > Participants > [Your user] > Reports > Today's logs
      Show
      Login as admin Switch to classic theme Create a new user Create a new course Enrol user as a student in course From the course participants page, click on the new user Press Reports > Today's logs Confirm you don't see the following exception in your webserver error logs: [php7:notice] [pid 32] [client 172.21.0.1:33918] Default exception handler: Coding error detected, it must be fixed by a programmer: Error: Can't find data record in database table course. (SELECT * FROM {course} WHERE id = ?\n[array (\n 0 => '0',\n)]) Debug: \nError code: codingerror\n* line 120 of /lib/ajax/getnavbranch.php: coding_exception thrown\n, referer: http://localhost:8000/report/log/user.php?id=3&course=2&mode=today Confirm the navigation block shows the following nodes expanded Dashboard > Courses > [Your course] > Participants > [Your user] > Reports > Today's logs

    Description

      Part of the 3.10 web server error logs review (MDL-69971).

      It has been detected that there is a coding_exception in the logs, only when using "classic", while running the 'Do a H5P attempt' behat feature (or, more exactly, when running the 'To an attempts and check on course log report' scenario within it.

      Error:

      [Wed Oct 21 11:31:42.709547 2020] [php7:notice] [pid 24769] [client 127.0.0.1:64373] Default exception handler: Coding error detected, it must be fixed by a programmer: Error: Can't find data record in database table course. (SELECT * FROM

      Unknown macro: {course}

      WHERE id = ?\n[array (\n 0 => '0',\n)]) Debug: \nError code: codingerror\n* line 120 of /lib/ajax/getnavbranch.php: coding_exception thrown\n, referer: http://127.0.0.1/~stronk7/behatgit/report/log/user.php?id=457001&course=185000&mode=today

      Reproduce it with:

      $  php admin/tool/behat/cli/run.php --profile=<<your_profile>> --suite=classic \
      --name='To an attempts and check on course log report'
      

      Note that the behat execution ends ok, for some reason that coding exception is not being caught (that can be normal). So just look to the web server logs to see it.

      The error is not reproducible before 3.10, so far.

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              stronk7 Eloy Lafuente (stronk7)
              Amaia Anabitarte Amaia Anabitarte
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Janelle Barcega Janelle Barcega
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 20 minutes
                  4h 20m