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

Upgrade to 2.6 fails with Database Error via admin upgrade page

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.6
    • Fix Version/s: None
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      Hi All
      Upgrading a site to 2.6+ can run into an issue where there is a specific db call that has a column that may not exist yet. Naturally
      this prevents you from upgrading to 2.6+ via the web interface.

      The workaround for now is to do the upgrade via the cli tool which adds the appropriate database column as part of the upgrade.

      The column is added in MDL-41436 so my guess is if you are on a version before that as well you won't have that column, so the admin page will error out.
      But I haven't been able to dig any futher.

      Stack Trace

      Debug info: Unknown column 'cacherev' in 'field list'
      SELECT id,shortname,fullname,format,enablecompletion,groupmode,groupmodeforce,cacherev FROM mdl_course WHERE id = ?
      [array (
      0 => '1',
      )]
      Error code: dmlreadexception
      Stack trace:

      line 441 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 996 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1415 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1387 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1366 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 609 of /lib/modinfolib.php: call to moodle_database->get_record()
      line 450 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()
      line 411 of /lib/modinfolib.php: call to course_modinfo->__construct()
      line 2003 of /lib/modinfolib.php: call to course_modinfo::instance()
      line 1832 of /lib/navigationlib.php: call to get_fast_modinfo()
      line 1899 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()
      line 438 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()
      line 1811 of /lib/navigationlib.php: call to format_base->extend_course_navigation()
      line 1114 of /lib/navigationlib.php: call to global_navigation->load_course_sections()
      line 222 of /blocks/navigation/block_navigation.php: call to global_navigation->initialise()
      line 178 of /blocks/navigation/block_navigation.php: call to block_navigation->get_navigation()
      line 296 of /blocks/moodleblock.class.php: call to block_navigation->get_content()
      line 238 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      line 956 of /lib/blocklib.php: call to block_base->get_content_for_output()
      line 1008 of /lib/blocklib.php: call to block_manager->create_block_contents()
      line 353 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      line 44 of /theme/essential/layout/general.php: call to block_manager->region_has_content()
      line 866 of /lib/outputrenderers.php: call to include()
      line 796 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      line ? of unknownfile: call to core_renderer->header()
      line 240 of /lib/outputrenderers.php: call to call_user_func_array()
      line 147 of /admin/renderer.php: call to plugin_renderer_base->__call()
      line 147 of /admin/renderer.php: call to core_admin_renderer->header()
      line 292 of /admin/index.php: call to core_admin_renderer->upgrade_confirm_page()

      To reproduce setup a 2.5 site, I think it needs to be a code rev before MDL41436, then pull in the 2.6 codebase version
      and hit the site to start the upgrade.

      Regards
      Francis

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              devinefran Francis Devine
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: