# java.lang.IllegalStateException: Failed to obtain node lock

**URL:** <https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681>\
**Category:** Elasticsearch\
**Created:** [February 1, 2019, 6:34am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681 "2019-02-01T06:34:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vineet\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineet_kumar/32/40459_2.png) [@Vineet\_Kumar](https://discuss.elastic.co/u/Vineet_Kumar)\
**Post date:** [February 1, 2019, 6:34am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681/1 "2019-02-01T06:34:52Z")

</div>

While starting Sonarqube, it stop and showing error for elastic seaach (es node):

2019.01.29 21:24:44 INFO es[o.s.p.ProcessEntryPoint] Starting es  
2019.01.29 21:24:44 INFO es[o.s.s.EsSettings] Elasticsearch listening on /127.0.0.1:9001  
2019.01.29 21:24:45 INFO es[o.elasticsearch.node] [sonarqube] version[2.4.4], pid[25515], build[fcbb46d/2017-01-03T11:33:16Z]  
2019.01.29 21:24:45 INFO es[o.elasticsearch.node] [sonarqube] initializing ...  
2019.01.29 21:24:45 INFO es[o.e.plugins] [sonarqube] modules , plugins , sites   
2019.01.29 21:24:46 WARN es[o.s.p.ProcessEntryPoint] Fail to start es  
java.lang.IllegalStateException: Failed to obtain node lock, is the following location writable?: [/paas/applications/sonar/sonarqube/sonarqube-6.5/data/es/sonarqube]  
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:199)  
at org.elasticsearch.node.Node.(Node.java:165)  
at org.elasticsearch.node.Node.(Node.java:140)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)  
at org.sonar.search.SearchServer.start(SearchServer.java:62)  
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:111)  
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:98)  
at org.sonar.search.SearchServer.main(SearchServer.java:109)  
Caused by: java.io.IOException: failed to obtain lock on /paas/applications/sonar/sonarqube/sonarqube-6.5/data/es/sonarqube/nodes/49  
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:186)  
... 7 common frames omitted  
Caused by: java.io.IOException: No locks available

Anybody has any solution for this problem?

---

<div class="post-metadata">

**Author:** ![Vineet\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineet_kumar/32/40459_2.png) [@Vineet\_Kumar](https://discuss.elastic.co/u/Vineet_Kumar)\
**Post date:** [February 1, 2019, 6:38am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681/2 "2019-02-01T06:38:12Z")

</div>

> [@Vineet\_Kumar](#):
>
> Failed to obtain node lock, is the following location writable?: [/paas/applications/sonar/sonarqube/sonarqube-6.5/data/es/sonarqube]

I checked the specified location, it has write permissions as well. Read somewhere that Sonar creates 50 es nodes (0-49). that why, now it's showing error because all 50 es nodes are already created.

Any idea, How to increase nodes or how to delete older nodes from Sonar database.?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 1, 2019, 8:43am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681/3 "2019-02-01T08:43:43Z")

</div>

> [@Vineet\_Kumar](#):
>
> Caused by: java.io.IOException: No locks available

I have seen this before when using a filesystem that doesn't support the kind of locking that Elasticsearch requires (particularly, some versions of NFS). What is your filesystem and is it on a local disk or is it somewhere network-attached?

---

<div class="post-metadata">

**Author:** ![Vineet\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineet_kumar/32/40459_2.png) [@Vineet\_Kumar](https://discuss.elastic.co/u/Vineet_Kumar)\
**Post date:** [February 1, 2019, 8:55am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681/4 "2019-02-01T08:55:40Z")

</div>

we have sonar on RHEL and DB (SQL Server) on another system with in network. it was working fine till 2 days back, once es node number reached to 49, then getting this error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 1, 2019, 8:55am UTC](https://discuss.elastic.co/t/java-lang-illegalstateexception-failed-to-obtain-node-lock/166681/5 "2019-03-01T08:55:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
