Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-6261

Global search indexing stopped working on learn.moodle.org



    • Bug
    • Status: Resolved
    • High
    • Resolution: Fixed
    • learn.moodle.org
    • None


      As discovered by marycooch, some learn.moodle.org scheduled tasks stopped working today (including essential ones such as automatic course approval).

      This was debugged to be caused by fatal failure of Global search indexing
      (\core\task\search_index_task) task:

      Execute scheduled task: Global search indexing (core\task\search_index_task)
      Processing area: Chat - activity information
        No new documents to index.
      Processing area: Course custom fields
      PHP Notice:  Undefined offset: 1 in /opt/app/course/classes/search/customfield.php on line 105
      Default exception handler: Exception - Call to a member function get() on null Debug: 
      Error code: generalexceptionmessage
      * line 110 of /course/classes/search/customfield.php: Error thrown
      * line ? of unknownfile: call to core_course\search\customfield->get_document()
      * line 103 of /lib/classes/dml/recordset_walk.php: call to call_user_func()
      * line 72 of /search/classes/skip_future_documents_iterator.php: call to core\dml\recordset_walk->current()
      * line 93 of /search/classes/skip_future_documents_iterator.php: call to core_search\skip_future_documents_iterator->current()
      * line 235 of /search/classes/engine.php: call to core_search\skip_future_documents_iterator->valid()
      * line 1153 of /search/classes/manager.php: call to core_search\engine->add_documents()
      * line 59 of /lib/classes/task/search_index_task.php: call to core_search\manager->index()
      * line 163 of /admin/tool/task/cli/schedule_task.php: call to core\task\search_index_task->execute()
      !!! Exception - Call to a member function get() on null !!!
      PHP Warning:  pg_last_error(): supplied resource is not a valid PostgreSQL link resource in /opt/app/lib/dml/pgsql_native_moodle_database.php on line 374
      PHP Fatal error:  Uncaught dml_read_exception: Error reading from database in /opt/app/lib/dml/moodle_database.php:486
      Stack trace:
      #0 /opt/app/lib/dml/pgsql_native_moodle_database.php(329): moodle_database->query_end(false)
      #1 /opt/app/lib/dml/pgsql_native_moodle_database.php(920): pgsql_native_moodle_database->query_end(false)
      #2 /opt/app/lib/dml/moodle_database.php(1624): pgsql_native_moodle_database->get_records_sql('SELECT pg_advis...', Array, 0, 0)
      #3 /opt/app/lib/classes/lock/postgres_lock_factory.php(187): moodle_database->get_record_sql('SELECT pg_advis...', Array)
      #4 /opt/app/lib/classes/lock/lock.php(102): core\lock\postgres_lock_factory->release_lock(Object(core\lock\lock))
      #5 /opt/app/lib/classes/lock/lock.php(116): core\lock\lock->release()
      #6 [internal function]: core\lock\lock->__destruct()
      #7 {main}
        thrown in /opt/app/lib/dml/moodle_database.php on line 486

      which then somehow blocks all other jobs from processing.

      We have had no custom course fields defined and there was no known change performed around the time this started to happen. The site had been restarted a hour earlier but the task did successfully run after that.


        Issue Links



              mudrd8mz David Mudrák (@mudrd8mz)
              mudrd8mz David Mudrák (@mudrd8mz)
              0 Vote for this issue
              3 Start watching this issue