Fixing "Lock obtain timed out: SimpleFSLock" for Solr

Updated . Posted . Visible to the public.

If your application raises an error like ...
Couldn't connect to the Solr server at http://127.0.0.1:8983/solr. 500 "Lock_obtain_timed_out_SimpleFSLock(...)"

... and if your jetty.request.log contains entries such as ...
127.0.0.1 - - [13/09/2011:12:42:23 +0000] "POST /solr/update HTTP/1.1" 500 4412
127.0.0.1 - - [13/09/2011:13:37:03 +0000] "POST /solr/update HTTP/1.1" 500 4309

... you probably have a lucene-...-write.lock file lying around in your Solr data directory that is not being cleaned up properly. This causes a 500 error code to be raised.

Make sure to shut down Solr before removing the lock file. Also check that all your data files are owned by the correct user: if you, at some point, started Solr as another user (maybe even root) you most likely have data or lock files with invalid ownership. If you do, chown them correctly.

Afterwards, start Solr again as the proper user.

Arne Hartherz
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-09-13 15:06)