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

Installation fails if admin->id is not 2

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide
      • Test installation on a normal database
      • In mysql alter the auto increment offset (google it) and test an installation - check you get the notice but things still install fine
      • Either set up a multimaster replication system or hack install.php line 159 and add a couple of users between guest and admin - check you get notices and things still install fine.
      • Run functional DB tests - just cause you can.
      Show
      Test installation on a normal database In mysql alter the auto increment offset (google it) and test an installation - check you get the notice but things still install fine Either set up a multimaster replication system or hack install.php line 159 and add a couple of users between guest and admin - check you get notices and things still install fine. Run functional DB tests - just cause you can.
    • Workaround:
      Hide

      By changing line 176 in lib/db/install.php to "if ($admin->id != 3) {" I was able to install without a problem. If the admin id must be 2, it should be set explicitly instead of relying on auto-increment. Otherwise, maybe it should just check that the admin user insert was successful?

      Show
      By changing line 176 in lib/db/install.php to "if ($admin->id != 3) {" I was able to install without a problem. If the admin id must be 2, it should be set explicitly instead of relying on auto-increment. Otherwise, maybe it should just check that the admin user insert was successful?
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-27767-master

      Description

      We array replicate our MySQL server to a co-located backup server. In order to further avoid index collisions, we offset the auto-incrementing (1 server uses odds, the other uses evens). However, while installing Moodle 2.0.3, it throws the exception "Unexpected new admin user id!" if the $admin->id is not 2 ( line 176 in lib/db/install.php ). There is a continue button below this, but when clicked it brings up two errors: "Config table does not contain version, can not continue, sorry." and "Coding error detected, it must be fixed by a programmer: block_manager has not yet loaded the blocks, to it is too soon to request the information you asked for."

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jan/12