Error in starting Camunda Optimize

Hi everyone,

I have a problem in running Optimize, when I double click “optimize-demo.bat”, optimize does not run and below is the contents of “optimize.log” file :

01:31:17.225 [main] INFO o.c.o.s.e.OptimizeElasticsearchClientFactory - Initializing Elasticsearch rest client…
01:31:17.705 [main] INFO o.c.o.s.e.OptimizeElasticsearchClientFactory - Elasticsearch client has successfully been started
01:31:17.952 [main] INFO o.c.o.s.e.s.ElasticsearchMetadataService - Was not able to retrieve metadata index!
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=index_not_found_exception, reason=no such index [optimize-metadata]]
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1706)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1683)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1446)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1403)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1373)
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:915)
at org.camunda.optimize.service.es.OptimizeElasticsearchClient.search(OptimizeElasticsearchClient.java:202)
at org.camunda.optimize.service.es.schema.ElasticsearchMetadataService.readMetadata(ElasticsearchMetadataService.java:89)
at org.camunda.optimize.service.es.schema.ElasticsearchMetadataService.validateSchemaVersionCompatibility(ElasticsearchMetadataService.java:62)
at org.camunda.optimize.service.es.schema.ElasticSearchSchemaManager.validateExistingSchemaVersion(ElasticSearchSchemaManager.java:113)
at org.camunda.optimize.service.es.OptimizeElasticsearchClientFactory.create(OptimizeElasticsearchClientFactory.java:41)
at org.camunda.optimize.service.es.OptimizeElasticsearchClientConfiguration.optimizeElasticsearchClient(OptimizeElasticsearchClientConfiguration.java:29)
at org.camunda.optimize.service.es.OptimizeElasticsearchClientConfiguration$$EnhancerBySpringCGLIB$$f6ad52bb.CGLIB$optimizeElasticsearchClient$0()
at org.camunda.optimize.service.es.OptimizeElasticsearchClientConfiguration$$EnhancerBySpringCGLIB$$f6ad52bb$$FastClassBySpringCGLIB$$8ce40795.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at org.camunda.optimize.service.es.OptimizeElasticsearchClientConfiguration$$EnhancerBySpringCGLIB$$f6ad52bb.optimizeElasticsearchClient()
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Does anyone know how to solve this problem?

Thanks

You might want to look at the overall health of your ES indexes and check your settings again. It looks like it’s looking for the default optimize prefix and optimize-metadata index is missing completely.

Something from the REST API would be a good start, e.g. GET {{elasticsearch}}/_cat/indices?v

thanks but I could not solve the problem, when I run ElasticSearch it has successfully been started, but when I run Optimize-startup.bat, I will get the below error:

Exception in thread “main” org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘definitionService’ defined in URL [jar:file:/C:/camunda-optimize-3.2.0/optimize-backend-3.2.0.jar!/org/camunda/optimize/service/DefinitionService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘definitionReader’ defined in URL [jar:file:/C:/camunda-optimize-3.2.0/optimize-backend-3.2.0.jar!/org/camunda/optimize/service/es/reader/DefinitionReader.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘optimizeElasticsearchClient’ defined in org.camunda.optimize.service.es.OptimizeElasticsearchClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.camunda.optimize.service.es.OptimizeElasticsearchClient]: Factory method ‘optimizeElasticsearchClient’ threw exception; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

Now your index is marked read only. Can’t really help you without any additional info. Try

PUT your_index/_settings
{
  "index": {
    "blocks.read_only": true
  }
}

Unfortunately I could not solve the problem :frowning_face:

I have not developed Camunda via spring boot, I just downloaded it and I am evaluating the optimize product.

Could you explain the solution in more detail? I tried running Optimize with both Tomcat and Wildfly ditribution but I got the same error as explanied.

Thanks

Hi @mrdavoodi64

could you share your elasticsearch log file?
Do you have enough diskspace for elasticsearch? Per default elastic has a pretty strict diskspace watermark and automatically marks indexes as read-only when there is not enough space on your disk available.

You might need to check https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-cluster.html#disk-based-shard-allocation and the config cluster.routing.allocation.disk.threshold_enabled
Best
Felix

Hi @felix-mueller

I have about 11GB free space in my drive, here is the optimize log file optimize.log (16.6 KB)

Thanks for your response

Hi @mrdavoodi64
it might be still a watermark issue. I would try the following:
a) Delete the existing elasticsearch data folder to make sure you start from scratch
b) Disable the watermark threshold in elasticsearch configuration (https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#disk-based-shard-allocation)
c) Start Optimize

There is a good blogpost about Elasticsearch Blocked Indexes here too: https://kb.objectrocket.com/elasticsearch/how-to-adjust-an-elasticsearch-clusters-disk-allocation-watermark

Hope this helps.

Best
Felix

1 Like

Thanks @felix-mueller
I deleted Elasticsearch, freed up more space in the drive and reextracted optimize zip file and optimize is running now.