Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.mode=local does not work with Grails 4 #76

Open
4 tasks done
miq opened this issue Apr 1, 2021 · 5 comments
Open
4 tasks done

client.mode=local does not work with Grails 4 #76

miq opened this issue Apr 1, 2021 · 5 comments

Comments

@miq
Copy link

miq commented Apr 1, 2021

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create a fresh grails 4 application with grails create-app four-oh-nine
  2. Add elasticsearchVersion stuff, compile dependency on the 3.0.0.M1 plugin and grails { pathingJar = true } in build.gradle
  3. Add elasticsearch configuration to application.yml as per documentation, setting client.mode: local

Expected Behaviour

Application starts up with an internal elasticsearch instance.

Actual Behaviour

2021-04-01 10:18:33.130 ERROR --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

java.net.ConnectException: Timeout connecting to [localhost/127.0.0.1:9200]
at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:823)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:248)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1611)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1581)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1551)
at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:130)
at org.elasticsearch.client.ClusterClient$health.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
at grails.plugins.elasticsearch.ElasticSearchAdminService$_waitForClusterStatus_closure19.doCall(ElasticSearchAdminService.groovy:434)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:37)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at grails.plugins.elasticsearch.ElasticSearchHelper.withElasticSearch(ElasticSearchHelper.groovy:12)
at grails.plugins.elasticsearch.ElasticSearchHelper$withElasticSearch.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at grails.plugins.elasticsearch.ElasticSearchAdminService.waitForClusterStatus(ElasticSearchAdminService.groovy:430)
at grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator.installMappings(SearchableClassMappingConfigurator.groovy:181)
at grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator.configureAndInstallMappings(SearchableClassMappingConfigurator.groovy:56)
at grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator$configureAndInstallMappings.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at grails.plugins.elasticsearch.ElasticsearchGrailsPlugin.doWithApplicationContext(ElasticsearchGrailsPlugin.groovy:153)
at org.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:507)
at org.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:223)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy:259)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy)
......
Caused by: java.net.ConnectException: Timeout connecting to [localhost/127.0.0.1:9200]

Environment Information

  • Operating System: Windows 10
  • Grails Version (if using Grails): 4.0.9
  • JDK Version: 1.8.0

Example Application

After having using a plugin version with #74 fixed:

https://github.com/miq/grails-4-elasticsearch-startup-issue

@demon101
Copy link

demon101 commented Jun 28, 2021

I have same issue with grails 4.0.11
waiting for release
https://github.com/puneetbehl/elasticsearch-grails-plugin/pull/75/files

@purpleraven
Copy link

The local type not possible anymore. external ES instance with transport type should be used in dev

@miq
Copy link
Author

miq commented Jan 7, 2022

@purpleraven Is there a good reason for that or does someone just have to implement a fix for reenabling the feature?

@purpleraven
Copy link

@miq https://grails-plugins.github.io/elasticsearch-grails-plugin/2.7.0.RC1/index.html

Embedded ES was removed and so there is no accurate possibility to run integration tests with ES, see here: https://discuss.elastic.co/t/in-memory-testing-with-resthighlevelclient/106196/6 . For now the integration tests are only working if a local elasticsearch version is running, which can be downloaded here: https://www.elastic.co/downloads/past-releases - please note that you’ve to use the same version like described in the above comments, so for now it is 6.8.2

@miq
Copy link
Author

miq commented Jan 11, 2022

Ok, so as I see it only the documentation has to be changed to reflect the removal of the feature. It is ok for us to use a dockerized elastic search in development and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants