Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20533

'Update Indices' System Status action can get tied up (index name already exists, localised dbs?)


    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.19
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
    • Funding Source:
      Needs Funding
    • Verified?:


      The 'Update Indices' action from the System Status page (aka System.updateindices) fails when an index of the same name already exists.  Errors are reported in the CiviCRM log but no error is displayed to the user and the warning persists (correctly, since the indices are still wrong).

      This occurs when the definition of an index has been changed since installation.

      There are two bugs here which want resolving:

      • If the System.updateIndexes API call returns an error, the interface does not notify this to the user. (split off to CRM-20602)
      • If one of the named indexes already exists, CRM_Core_BAO_SchemaHandler::createMissingIndexes() will fail with a DB error rather than skipping index creation.

      Since the method is createMissingIndexes() not rebuildIndexes() it feels OK to skip attempts to create an index that already exists. If this function is actually expected to regenerate existing indexes if they don't match Civi's expected state, we should instead check the state of the index not just its presence (and rename the method to correctly describe its purpose).




            • Assignee:
              ayduns Aidan Saunders
            • Votes:
              3 Vote for this issue
              32 Start watching this issue


              • Created: