java.lang.IllegalStateException: Failed to obtain node lock

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?

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.?

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?

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.

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