Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-5106

Starting Optimize 3.4.0 with the "--upgrade" option fails if schema is already migrated or not existing

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L2 - Critical L2 - Critical
    • 3.4.0
    • 3.4.0
    • backend
    • None
    • Not defined

      Given:
      The optimize docker container is started with the "--upgrade" flag as described in :
      https://docs.camunda.org/optimize/develop/technical-guide/update/#3-2-automatic-upgrade-execution-optimize-3-2-0
      AND no schema is present

      When:
      The container starts and tries to perform the update

      Then:
      It fails with:

      
      Starting Camunda Optimize Upgrade to 3.4.0-RC1...
      
      12:36:08.109 [main] DEBUG o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Elasticsearch username and password not provided, skipping connection credential setup.
      Exception in thread "main" java.lang.ExceptionInInitializerError
      Caused by: org.camunda.optimize.service.exceptions.OptimizeRuntimeException: Failed retrieving aliases for dynamic index prefix camunda-activity-event-
      	at org.camunda.optimize.upgrade.util.MappingMetadataUtil.retrieveAllDynamicIndexKeysForPrefix(MappingMetadataUtil.java:165)
      	at org.camunda.optimize.upgrade.util.MappingMetadataUtil.retrieveAllCamundaActivityEventIndices(MappingMetadataUtil.java:117)
      	at org.camunda.optimize.upgrade.util.MappingMetadataUtil.getAllDynamicMappings(MappingMetadataUtil.java:149)
      	at org.camunda.optimize.upgrade.util.MappingMetadataUtil.getAllMappings(MappingMetadataUtil.java:66)
      	at org.camunda.optimize.upgrade.es.SchemaUpgradeClientFactory.createSchemaUpgradeClient(SchemaUpgradeClientFactory.java:37)
      	at org.camunda.optimize.upgrade.es.SchemaUpgradeClientFactory.createSchemaUpgradeClient(SchemaUpgradeClientFactory.java:24)
      	at org.camunda.optimize.upgrade.main.UpgradeProcedureFactory.create(UpgradeProcedureFactory.java:22)
      	at org.camunda.optimize.upgrade.main.UpgradeMain.<clinit>(UpgradeMain.java:37)
      Caused by: java.net.ConnectException: Connection refused
      	at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:865)
      	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:275)
      	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:262)
      	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1628)
      	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1598)
      	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1568)
      	at org.elasticsearch.client.IndicesClient.getAlias(IndicesClient.java:1315)
      	at org.camunda.optimize.service.es.OptimizeElasticsearchClient.getAlias(OptimizeElasticsearchClient.java:146)
      	at org.camunda.optimize.upgrade.util.MappingMetadataUtil.retrieveAllDynamicIndexKeysForPrefix(MappingMetadataUtil.java:161)
      	... 7 more
      Caused by: java.net.ConnectException: Connection refused
      	at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
      	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)
      	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
      	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
      	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
      	at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
      	at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      
      Starting Camunda Optimize Upgrade to 3.4.0-RC1...
      
      12:36:24.367 [main] DEBUG o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Elasticsearch username and password not provided, skipping connection credential setup.
      12:36:25.239 - Elasticsearch exception [type=index_not_found_exception, reason=no such index [optimize-decision-instance]]
      org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=index_not_found_exception, reason=no such index [optimize-decision-instance]]
      	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:187)
      	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1907)
      	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1884)
      	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1641)
      	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1598)
      	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1568)
      	at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1084)
      	at org.camunda.optimize.service.es.OptimizeElasticsearchClient.search(OptimizeElasticsearchClient.java:216)
      	at org.camunda.optimize.upgrade.plan.factories.Upgrade33To34PlanFactory.getAllExistingDefinitionKeys(Upgrade33To34PlanFactory.java:395)
      	at org.camunda.optimize.upgrade.plan.factories.Upgrade33To34PlanFactory.createUpgradePlan(Upgrade33To34PlanFactory.java:81)
      	at org.camunda.optimize.upgrade.plan.UpgradePlanRegistry.lambda$new$0(UpgradePlanRegistry.java:35)
      	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      	at org.camunda.optimize.upgrade.plan.UpgradePlanRegistry.<init>(UpgradePlanRegistry.java:31)
      	at org.camunda.optimize.upgrade.main.UpgradeMain.main(UpgradeMain.java:51)
      	Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://elasticsearch:9200], URI [/optimize-decision-instance/_search?typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 404 Not Found]
      {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [optimize-decision-instance]","resource.type":"index_or_alias","resource.id":"optimize-decision-instance","index_uuid":"_na_","index":"optimize-decision-instance"}],"type":"index_not_found_exception","reason":"no such index [optimize-decision-instance]","resource.type":"index_or_alias","resource.id":"optimize-decision-instance","index_uuid":"_na_","index":"optimize-decision-instance"},"status":404}
      		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:318)
      		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
      		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:262)
      		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1628)
      		... 10 common frames omitted
      

      Expected:
      The upgrade should just get skipped if there is no existing schema

        This is the controller panel for Smart Panels app

              Unassigned Unassigned
              sebastian.bathke Sebastian Bathke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: