{"id":84,"date":"2015-11-11T14:04:57","date_gmt":"2015-11-11T14:04:57","guid":{"rendered":"http:\/\/blog.lexxweb.co.uk\/?p=84"},"modified":"2015-12-23T12:27:11","modified_gmt":"2015-12-23T12:27:11","slug":"elasticsearch-issues-upgrading-from-ubuntu-15-04-15-10","status":"publish","type":"post","link":"https:\/\/blog.lexxweb.co.uk\/?p=84","title":{"rendered":"ElasticSearch issues upgrading from Ubuntu 15.04 -> 15.10"},"content":{"rendered":"<p>For some bizarre reason when we did an upgrade from ubuntu 15.04 to 15.10 and elasticsearch was updated from v1.4.5 to v1.6.2 elasticsearch would not start (although systemctl thought it had each time).<\/p>\n<p>Immediately after the upgrade, we received error messages from our application saying it could not connect to elasticsearch.<\/p>\n<p>Sure enough trying to connect to the elasticsearch service failed when we attempted to use <code>curl -XGET 'localhost:9200' <\/code><\/p>\n<p>Another strange thing is that systemctl says that elasticsearch is running perfectly, even though the process is not running when we execute ps -aux | grep elastic &#8230;<\/p>\n<p>It turns out the elasticsearch.pid file had been deleted in the upgrade and the elasticsearch user could not create a new one.<br \/>\n<code><br \/>\ntouch \/var\/run\/elasticsearch.pid<br \/>\nchown elasticsearch \/var\/run\/elasticsearch.pid<br \/>\n<\/code><\/p>\n<p>However, that is not all, I started receiving a new and exciting error message (see stack trace below). <!--more--><br \/>\nThis one turned out to be a failed plugin called marvel. In order to fix this error all you have to do is the following:<br \/>\n<code><br \/>\ncd \/usr\/share\/elasticsearch<br \/>\nsudo bin\/plugin --remove elasticsearch\/marvel\/latest<br \/>\nsudo bin\/plugin -i elasticsearch\/marvel\/latest<br \/>\n<\/code><\/p>\n<p>There are a few items to configure before the newly upgraded elasticsearch will work:<br \/>\n<code>sudo vim \/etc\/elasticsearch\/elasticsearch.yml <\/code><br \/>\nEdit the following lines:<br \/>\n<code><br \/>\nnetwork.host: localhost<br \/>\nnetwork.bind_host: 0.0.0.0<br \/>\n<\/code><\/p>\n<p>Finally, we have to fix a broken init.d script:<br \/>\n<code><br \/>\nsudo vim \/etc\/init.d\/elasticsearch<br \/>\n<\/code><br \/>\nComment out this line<br \/>\n<code><br \/>\ntest \"$START_DAEMON\" = true || exit 0<br \/>\n<\/code><\/p>\n<p>Then you need to run the following:<br \/>\n<code><br \/>\nsudo systemctl daemon-reload<br \/>\nsudo service stop elasticsearch<br \/>\nsudo service start elasticsearch<br \/>\n<\/code><\/p>\n<p>After this restart elasticsearch came back to life. \ud83d\ude42<\/p>\n<p><span style=\"color: #993300;\"><br \/>\n<code><br \/>\n[2015-11-11 11:44:39,433][ERROR][bootstrap                ] Exception<br \/>\norg.elasticsearch.common.util.concurrent.ExecutionError: org.elasticsearch.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lorg\/elasticsearch\/indices\/InternalIndicesService;<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2201)<br \/>\n        at org.elasticsearch.common.cache.LocalCache.get(LocalCache.java:3937)<br \/>\n        at org.elasticsearch.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)<br \/>\n        at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:51)<br \/>\n        at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)<br \/>\n        at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:50)<br \/>\n        at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:372)<br \/>\n        at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:148)<br \/>\n        at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:204)<br \/>\n        at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:119)<br \/>\n        at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:102)<br \/>\n        at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)<br \/>\n        at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)<br \/>\n        at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)<br \/>\n        at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:212)<br \/>\n        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)<br \/>\n        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:77)<br \/>\n        at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:245)<br \/>\n        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)<br \/>\nCaused by: org.elasticsearch.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lorg\/elasticsearch\/indices\/InternalIndicesService;<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2201)<br \/>\n        at org.elasticsearch.common.cache.LocalCache.get(LocalCache.java:3937)<br \/>\n        at org.elasticsearch.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)<br \/>\n        at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:51)<br \/>\n        at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:68)<br \/>\n        at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:67)<br \/>\n        at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)<br \/>\n        at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)<br \/>\n        at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)<br \/>\n        at org.elasticsearch.common.inject.internal.FailableCache$1.load(FailableCache.java:39)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2197)<br \/>\n... 19 more<br \/>\nCaused by: java.lang.NoClassDefFoundError: Lorg\/elasticsearch\/indices\/InternalIndicesService;<br \/>\n        at java.lang.Class.getDeclaredFields0(Native Method)<br \/>\n        at java.lang.Class.privateGetDeclaredFields(Class.java:2509)<br \/>\n        at java.lang.Class.getDeclaredFields(Class.java:1819)<br \/>\n        at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:378)<br \/>\n        at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:376)<br \/>\n        at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:351)<br \/>\n        at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:345)<br \/>\n        at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:287)<br \/>\n        at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:80)<br \/>\n        at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:36)<br \/>\n        at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:45)<br \/>\n        at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:41)<br \/>\n        at org.elasticsearch.common.inject.internal.FailableCache$1.load(FailableCache.java:39)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)<br \/>\n        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2197)<br \/>\n        ... 33 more<br \/>\nCaused by: java.lang.ClassNotFoundException: org.elasticsearch.indices.InternalIndicesService<br \/>\n        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)<br \/>\n        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)<br \/>\n        at java.security.AccessController.doPrivileged(Native Method)<br \/>\n        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)<br \/>\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)<br \/>\n        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)<br \/>\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)<br \/>\n        ... 50 more<br \/>\n<\/init><\/code><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some bizarre reason when we did an upgrade from ubuntu 15.04 to 15.10 and elasticsearch was updated from v1.4.5 to v1.6.2 elasticsearch would not start (although systemctl thought it had each time). Immediately after the upgrade, we received error messages from our application saying it could not connect to elasticsearch. Sure enough trying to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,7,21,4],"tags":[],"class_list":["post-84","post","type-post","status-publish","format-standard","hentry","category-general","category-java","category-operating-systems","category-programming"],"_links":{"self":[{"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=84"}],"version-history":[{"count":7,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lexxweb.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}