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

Cron DB error on postgres : column "co.id" must appear in the GROUP BY clause or be used in an aggregate function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Duplicate
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      during first web run of cron after fresh 2.0.2 install (after some mbz course restores and a borked restore (Films from mooch), which shouldn't have anything to do with this.)


      Running clean-up tasks...
      Deleted old cache_text records
      checking for create_password
      !!! Error reading from database !!!
      !! ERROR: column "co.id" must appear in the GROUP BY clause or be used in an aggregate function
      LINE 1: SELECT ta.tagid, tb.tagid AS correlation, co.id AS correlati...
      ^
      SELECT ta.tagid, tb.tagid AS correlation, co.id AS correlationid, co.correlatedtags
      FROM mdl_tag_instance ta
      LEFT JOIN mdl_tag_instance tb
      ON (ta.itemtype = tb.itemtype AND ta.itemid = tb.itemid AND ta.tagid <> tb.tagid)
      LEFT JOIN mdl_tag_correlation co
      ON co.tagid = ta.tagid
      WHERE tb.tagid IS NOT NULL
      GROUP BY ta.tagid, tb.tagid
      HAVING COUNT > $1
      ORDER BY ta.tagid ASC, COUNT DESC, tb.tagid ASC
      [array (
      0 => 2,
      )] !!
      !! Stack trace: * line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown

      • line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      • line 634 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      • line 844 of /tag/lib.php: call to pgsql_native_moodle_database->get_recordset_sql()
      • line 910 of /tag/lib.php: call to tag_compute_correlations()
      • line 310 of /lib/cronlib.php: call to tag_cron()
      • line 79 of /admin/cron.php: call to cron_run()
        !!

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              nebgor Aparup Banerjee
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: