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

Quiz statistics task invalid input syntax for type bigint: "s178604" errors

    XMLWordPrintable

Details

    Description

      I'm seeing lots of errors in the quiz_statistics\task\recalculate scheduled task on one of our sites (multiple quizzes) with an error that looks like the below.

      it looks like the question ids have an "s" character being included in the id number somehow.

       

          Calculating statistics for 159 attempts, starting at 11/01/23, 03:28:33 ...
      Error reading from database
       
      ERROR:  invalid input syntax for type bigint: "s178604"
      SELECT q.*,
                         qc.id as category,
                         qv.status,
                         qv.id as versionid,
                         qv.version,
                         qv.questionbankentryid,
                         qc.contextid as contextid
                         
                    FROM mdl_question q
                    JOIN mdl_question_versions qv
                      ON qv.questionid = q.id
                    JOIN mdl_question_bank_entries qbe
                      ON qbe.id = qv.questionbankentryid
                    JOIN mdl_question_categories qc
                      ON qc.id = qbe.questioncategoryid
                    
                    WHERE q.id IN ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25)
                    
      [array (
        0 => 's178604',
        1 => 's178600',
        2 => 's178599',
        3 => 's178598',
        4 => 's178597',
        5 => 's178596',
        6 => 's178603',
        7 => 's178595',
        8 => 's178602',
        9 => 's178601',
        10 => '411477',
        11 => '411484',
        12 => '411490',
        13 => '411478',
        14 => '411480',
        15 => '411479',
        16 => '411486',
        17 => '411491',
        18 => '411487',
        19 => '411489',
        20 => '411466',
        21 => '411488',
        22 => '411481',
        23 => '411482',
        24 => '411483',
      )]
      Error code: dmlreadexception
       
      * line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
      * line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
      * line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
      * line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      * line 905 of /lib/questionlib.php: call to pgsql_native_moodle_database->get_records_sql()
      * line 924 of /lib/questionlib.php: call to question_preload_questions()
      * line 852 of /mod/quiz/report/statistics/report.php: call to question_load_questions()
      * line 939 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->load_and_initialise_questions_for_calculations()
      * line 105 of /mod/quiz/report/statistics/classes/task/recalculate.php: call to quiz_statistics_report->calculate_questions_stats_for_question_bank()

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              danmarsden Dan Marsden
              Dan Marsden Dan Marsden
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Clockify

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