While upgrading our projet from spring-boot 3.0.2 to 3.0.7, I'm facing a problem with Elasticsearch
I suspect that is related to the version of Elasticsearch server we use that is not compatible with SB 3.0.7.
When I uploaded to v7.10.1 of elasticsearch server, it worked without problem When I changed the docker image to use elasticsearch v6.8.23, it also worked
So, I don't khow if it is really a problem of compatibilty between the version of spring boot and elasticsearch server/client versions (or anything else)
implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: **'6.8.23'**
implementation group: 'org.elasticsearch', name: 'elasticsearch', version: **'6.8.23'**
**implementation group: 'org.springframework.data', name: 'spring-data-commons'**
We are using spring-data-commons instead of spring-data-elasticsearch
We are using this docker-compose.yml file for tests
version: "2"
services:
elasticsearch:
** image: elasticsearch:7.10.1**
ports:
- 9200:9200
environment:
- discovery.type=single-node
Here is the error:
Caused by: ElasticsearchException[Error while creating index usedcars_vehicle_20230616_102841973_fr_fr]; nested: IOException[listener timeout after waiting for [90000] ms];
at com.renault.wired.elasticsearch.rest.repository.IndicesRepositoryImpl.createIndex(IndicesRepositoryImpl.java:102)
at com.renault.wired.elasticsearch.rest.repository.IndicesRepositoryImpl.createNextIndex(IndicesRepositoryImpl.java:111)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:288)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120)
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:516)
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:628)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:168)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)
at jdk.proxy2/jdk.proxy2.$Proxy65.createNextIndex(Unknown Source)
at com.renault.wired.elasticsearch.rest.init.ElasticsearchPopulator.populate(ElasticsearchPopulator.java:42)
at com.renault.wired.elasticsearch.rest.init.ElasticsearchRepositoryPopulatorFactoryBean.onApplicationEvent(ElasticsearchRepositoryPopulatorFactoryBean.java:38)
at com.renault.wired.elasticsearch.rest.init.ElasticsearchRepositoryPopulatorFactoryBean.onApplicationEvent(ElasticsearchRepositoryPopulatorFactoryBean.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:437)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:961)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:611)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1388)
at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:545)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:184)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:118)
... 72 more