KBEC-00507 - How to resolve Elasticsearch index error during DevOpsInsight Upgrade from 9.0.x to 10.2.x

Article ID:4405756670619
2 minute readKnowledge base

Issue

Upgrading CloudBees Analytics (DevOpsInsight) from 9.0.x to 10.2.0 fails with the following error:

java.lang.IllegalStateException: The index [xyz] was created with version [5.3.1] but the minimum compatible version is [6.0.0-beta1]. It should be re-indexed in Elasticsearch 6.x before upgrading to 7.10.2.

In this article we will explain how to resolve this error.

Resolution

The quickest resolution is to install 10.3.0 or later as the issue should be fixed in the 10.3 release.

If you need 10.2.x for some reason, please follow the steps below:

  1. Restore the DevOpsInsight server to 9.0.x which was backed up prior to the upgrade.

  2. Upgrade the instance to 10.0.

  3. Check for old indices and decide how to fix them. Most likely, these indices can be simply removed.

3.1 Use this curl command to check for old indices (remember to modify the two CD paths according to your installation, otherwise you will get an authorization error):

$ curl -ks -H 'Content-Type: application/json' -H 'Accept: application/json' -E /opt/electriccloud/electriccommander/conf/reporting/elasticsearch/admin.crtfull.pem --key /opt/electriccloud/electriccommander/conf/reporting/elasticsearch/admin.key.pem -XGET 'https://localhost:9200/_settings?pretty'

The command will return an output similar to the following:

{
  "searchguard" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "auto_expand_replicas" : "0-all",
        "provided_name" : "searchguard",
        "creation_date" : "1628520959795",
        "number_of_replicas" : "0",
        "uuid" : "Pz4psWMCQmWQZODg48PUpw",
        "version" : {
          "created" : "5030199",
          "upgraded" : "6060299"
        }
      }
    }
  }
}

Here we can see that the searchguard index has a "created" field of 5030199. This means the index was created in Elasticsearch v5.3.1. You can safely remove the searchguard index.

3.2. To remove the old indices, use the curl command:

$ curl -ks -H 'Content-Type: application/json' -H 'Accept: application/json' -E /opt/electriccloud/electriccommander/conf/reporting/elasticsearch/admin.crtfull.pem --key /opt/electriccloud/electriccommander/conf/reporting/elasticsearch/admin.key.pem -XDELETE 'https://localhost:9200/searchguard?pretty'
{
  "acknowledged" : true
}

where -XDELETE '<https://localhost:9200/searchguard?pretty'> means deleting the index named "searchguard".

3.3. Repeat the curl command from 3.1 to make sure that ES instance doesn’t contain indices that were created in Elasticsearch v5.x.

  1. Upgrade the instance to DOIS 10.2.x.

If you face any indices that cannot be deleted, then please contact CloudBees Support for help.