Elasticsearch, Failed to obtain node lock, is the following location writable

java.lang.illegalstateexception: failed to obtain node locks windows
elasticsearch failed to obtain node locks windows
java.lang.illegalstateexception failed to obtain node locks sonarqube
failed to obtain node locks, tried [[/usr/share/elasticsearch/data]] with lock id [0]
exception java lang illegalstateexception failed to obtain node locks
elasticsearch lock assertion failed
elasticsearch environment is not locked
org elasticsearch bootstrap startupexception java lang illegalstateexception

Elasticsearch won't start using ./bin/elasticsearch. It raises the following exception:

- ElasticsearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/home/user1/elasticsearch-1.4.4/data/elasticsearch]

I checked the permissions on the same location and the location has 777 permissions on it and is owned by user1.

ls -al /home/user1/elasticsearch-1.4.4/data/elasticsearch
drwxrwxrwx  3 user1 wheel 4096 Mar  8 13:24 .
drwxrwxrwx  3 user1 wheel 4096 Mar  8 13:00 ..
drwxrwxrwx 52 user1 wheel 4096 Mar  8 13:51 nodes

What is the problem?

Trying to run elasticsearch 1.4.4 on linux without root access.

I had an orphaned Java process related to Elasticsearch. Killing it solved the lock issue.

ps aux | grep 'java'
kill -9 <PID>

How to solve node lock error in elasticsearch?, "java.lang.IllegalStateException: Failed to obtain node lock, is the following location writable?: [/media/amit/208B7C972F88BACC/… Failed to obtain node lock, is the following location writable. There might be more to the exception telling you the cause of the failure to the obtain the node lock.

I got this same error message, but things were mounted fine and the permissions were all correctly assigned.

Turns out that I had an 'orphaned' elasticsearch process that was not being killed by the normal stop command.

I had to manually kill the process and then restarting elasticsearch worked again.

Failed to obtain node lock - Elasticsearch, Exception in thread "Thread-500" org.elasticsearch. ElasticSearchIllegalStateException: Failed to obtain node lock, is the following location writable?: "java.lang.IllegalStateException: Failed to obtain node lock, is the following location writable?" Zoran_Jeremic (Zoran Jeremic) July 29, 2016, 4:46pm #6 Hi @Rajnikant ,

the reason is another instance is running! first find the id of running elastic.

ps aux | grep 'elastic'

then kill using kill -9 <PID_OF_RUNNING_ELASTIC>. There were some answers to remove node.lock file but that didn't help since the running instance will make it again!

PATH.DATA Failed to obtain node lock, is the following location , IllegalStateException: Failed to obtain node lock, is the following location writable​?: [/mnt/disk1/elasticsearch-data/elasticsearch,  PATH.DATA Failed to obtain node lock, is the following location writable? Mar 30, 2016 clintongormley added >enhancement help wanted :Exceptions labels Mar 30, 2016

In my situation I had wrong permissions on the ES dir folder. Setting correct owner solved it.

# change owner
chown -R elasticsearch:elasticsearch /data/elasticsearch/

# to validate
ls /data/elasticsearch/ -la
# prints    
# drwxr-xr-x 2 elasticsearch elasticsearch 4096 Apr 30 14:54 CLUSTER_NAME

Elasticsearch init fails, because it failed to obtain node locks · Issue , Elasticsearch init fails, because it failed to obtain node locks #11 lock id [0]; maybe these locations are not writable or multiple nodes were  This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

After I upgraded the elasticsearch docker-image from version 5.6.x to 6.3.y the container would not start anymore because of the aforementioned error

Failed to obtain node lock

In my case the root-cause of the error was missing file-permissions

The data-folder used by elasticsearch was mounted from the host-system into the container (declared in the docker-compose.yml):

    volumes:
      - /var/docker_folders/common/experimental-upgrade:/usr/share/elasticsearch/data

This folder could not be accessed anymore by elasticsearch for reasons I did not understand at all. After I set very permissive file-permissions to this folder and all sub-folders the container did start again.

I do not want to reproduce the command to set those very permissive access-rights on the mounted docker-folder, because it is most likely a very bad practice and a security-issue. I just wanted to share the fact that it might not be a second process of elasticsearch running, but actually just missing access-rights to the mounted folder.

Maybe someone could elaborate on the apropriate rights to set for a mounted-folder in a docker-container?

How to solve the error "failed to obtain node locks" in ELK?, We are seeing the following error message. Caused by: java.lang.​IllegalStateException: failed to obtain node locks, tried [[$EGO_SHARE_TOP/  Failed to obtain node lock. Hi, I have the following problem if I'm using local node. It works find with elasticsearch server, but if I switch to the local node, then application creates 50

61846, java.lang.IllegalStateException: failed to obtain node locks, tried [0]; maybe these locations are not writable or multiple nodes were started Hi, I'm running ES in a FreeBSD jail, so there is no fstab and no mount point visible. And since I upgraded ES to version 1.6, it no longer start because it fails to obtain a lock because "Mount point not found in fstab" (file permission

[Elasticsearch] failed to obtain node locks, [Elasticsearch] failed to obtain node locks elasticsearch 를 사용하다가 갑자기 lock id [0]; maybe these locations are not writable or multiple nodes were started -failed-to-obtain-node-lock-is-the-following-location-writable. I can't run a command on the container if I attach the volume because it fails during startup. If there's a way around that, please let me know.

Elasticsearch, NFS, and locking issues, IllegalStateException: failed to obtain node locks, tried [[/usr/share/elasticsearch/​data]] with lock id [0]; maybe these locations are not writable or  We generally suggest that people ensure any location that should be written to by the container process is writable by UID 1000 on the host system itself. jarpy closed this Jun 20, 2017 This comment has been minimized.

Comments
  • I also got this error message with a fresh new debian elasticsearch 1.4.4 installation. A simple reboot helped to make this message dissappear.
  • This applies to Dockerized Elasticsearch also. My host was not showing any Elasticsearch containers, but it seems the last daemon restart left the host process orphaned, without even showing at docker ps -a. This fixed the issue. Thanks
  • Perfect. Somehow I had 2 instances caught by the grep.
  • On OSX, with brew, the node locks are files written somewhere under /usr/local/var/elasticsearch/nodes If you had an old ElasticSearch sitting around like I did, you can start by either trying to delete a specific node.lock file or go nuclear and rm -rf the nodes folder.
  • Thanks. Onn a centos7.x , my OS partition mounted for ES data were at 100% due to poor system maintenance (growing indices not pruned or archived offline). ES stopped working. On clearing the directory and rebooting, the error "..org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried" came up. The solution was identifying the old ES pid and killing it. before restart.