Failed to obtain node locks

java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Users\AnilY\Downloads\sonarqube-\sonarqube-\data\es7]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.(
at org.elasticsearch.node.Node.(
at org.elasticsearch.node.Node.(
at org.elasticsearch.bootstrap.Bootstrap$5.(
at org.elasticsearch.bootstrap.Bootstrap.setup(
at org.elasticsearch.bootstrap.Bootstrap.init(
at org.elasticsearch.bootstrap.Elasticsearch.init(
at org.elasticsearch.bootstrap.Elasticsearch.execute(
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
at org.elasticsearch.cli.Command.main(
at org.elasticsearch.bootstrap.Elasticsearch.main(
at org.elasticsearch.bootstrap.Elasticsearch.main(


Welcome to the community!

I’ve moved your post to a new topic since the one you added to was 3 years old. Please add some details here. Simply dumping a partial stacktrace doesn’t help us help you.


Can someone pls help me with issue.
I am stuck since long time.

What more info is required.
Java 11 is used.

Hi @Anil_Kumar1 ,

the error message you posted suggests that elasticsearch is not able to acquire a lock for its data directory (C:\Users\AnilY\Downloads\sonarqube-\sonarqube-\data\es7). this can be caused by a few circumstances as

  • there is another sonarqube instance already running that is holding this lock
  • the location is not writable by sonarqube
  • a sonarqube instance crashed so badly that it could not remove the lock

i assume that this is currently only a test instance without much data in there, so after checking that there is no other sonarqube instance running and that sonarqube is able to write to this folder, you can simply delete the es7 folder as it will be recreated by sonarqube on start.

if you have not switched your sonarqube version in the mean time i assume this is on version 8.0 and not 7.9.6 as 7.9.6 shipped es6

As @Tobias_Trabelsi mentioned you need to remove es7 folder in node lock situation, I just handle that by defining new extraInitContainer:

  - name: "fix-elastic-error-lock-issue"
      image: "busybox"
      imagePullPolicy: "IfNotPresent"
      command: ["rm", "-rf", "/opt/sonarqube/data/es7"]
        - mountPath: /opt/sonarqube/data
          name: sonarqube
          subPath: es7