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

IllegalStateException: path.home is not configured #190

Closed
mtgleeson opened this issue Jan 17, 2017 · 6 comments
Closed

IllegalStateException: path.home is not configured #190

mtgleeson opened this issue Jan 17, 2017 · 6 comments

Comments

@mtgleeson
Copy link

mtgleeson commented Jan 17, 2017

I'm getting an exception when using Elasticsearch 1.2.0 plugin with grails 3.2.4 and Elasticsearch 2.3.1.
The elasticsearch plugin is configured in mode 'node' and apparently this requires a path.name setting to be set.

I'm not sure why a path.name needs to be set if the mode is 'node' and not 'local' or 'dataNode' which stores data.
I've worked around this by setting a dummy path.name in the JAVA__OPTS in /etc/default/tomcat8 i.e. -Des.path.home=/tmp

Is there a better workaround/fix for this?
elastic/elasticsearch#13155

Caused by: java.lang.IllegalStateException: path.home is not configured
	at org.elasticsearch.env.Environment.<init>(Environment.java:101)
	at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:81)
	at org.elasticsearch.node.internal.InternalSettingsPreparer$prepareEnvironment.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at grails.plugins.elasticsearch.ClientNodeFactoryBean$PluginEnabledNode.<init>(ClientNodeFactoryBean.groovy:241)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite.callConstructor(ConstructorSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:255)
	at grails.plugins.elasticsearch.ClientNodeFactoryBean.getObject(ClientNodeFactoryBean.groovy:203)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
	... 51 more
@puneetbehl
Copy link
Collaborator

@mtgleeson please look into documentation under section "2.2.1. Using node or dataNode during development"

@mtgleeson
Copy link
Author

I'm getting this problem on all environments incl prod when using 'node' as the client mode.

@puneetbehl
Copy link
Collaborator

@mtgleeson I am sorry for the confusion but I was checking whether you have configured es.path.home in VM_OPTIONS, which I am referring in documentation under section 2.2.1

@mtgleeson
Copy link
Author

Thanks @puneetbehl

@wladimirguerra
Copy link

wladimirguerra commented Mar 9, 2018

I am having same exception on Grails 3.3.2. I need to make a fully executable archive with assemble task.
So my config has:

def esVersion = '5.4.1'
ext['elasticsearch.version'] = esVersion
ext {
    elasticsearchVersion = esVersion
}

dependencies {
     ...
     /**
     * From
     * https://github.com/noamt/elasticsearch-grails-plugin/issues/198#issuecomment-354566880
     */
    compile 'org.grails.plugins:elasticsearch:2.4.0.RC1'
    runtime 'org.elasticsearch.plugin:mapper-attachments:2.4.6'
     ...
} 

bootRun {
    jvmArgs = ['-Dspring.output.ansi.enabled=always','-Des.path.home=/my/home/dir/.elasticsearch']
    addResources = true
}

springBoot {
    // Enable the creation of a fully executable
    // archive file with <assemble> task.
    executable = true
}

As I was getting the exception I followed the Spring Boot Application docs
and created a .conf file with:

JAVA_OPTS=-Des.path.home=/my/home/dir/.elasticsearch

on the same dir of my .war file generated by the assemble task. But I am still getting the exception.

So I've made a runnable war file following Grails Deployment and executed parsing the -Des.path.home=/my/home/dir/.elasticsearch, but no luck.

Either node or local doesn't work on executing the war files, but oddly the node or local mode on my development environment works fine.

Is the assemble task causing this issue?

@puneetbehl
Copy link
Collaborator

@WAGuerra I am sure there must be some configuration issue as I have successfully tested this behavior in the past. I am the Greach conference this week so I might not be able to look into this right now. I will try to look into this next week. Meanwhile, if you find anything please let me know.

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