Read more

Fixing "Lock obtain timed out: SimpleFSLock" for Solr

Arne Hartherz
September 13, 2011Software engineer at makandra GmbH

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(...)"

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

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

Posted by Arne Hartherz to makandra dev (2011-09-13 17:06)