I've been using the Lucene module on a few of my sites, hosted on my server, for a few years. They've been working well until a few months ago, when suddenly these sites started reporting errors, along the lines of:
[Error] Uncaught Zend_Search_Lucene_Exception: File '/tmp/silverstripe-cache-php5.6.20-home-sitename-public_html/sitename/Silverstripe/_dhq.cfs' is not readable.
/home/sitename/public_html/lucene/thirdparty/Zend/Search/Lucene/Storage/File/Filesystem.php:56
(Where sitename is unique to the website)
At this point the error is triggered whenever someone attempts a Lucene search on the frontend, or if a CMS user attempts to save a page in the backend.
That directory does exist, and it does contain .cfs files, but none with the name specified.
I have to run a /dev/build and then a /dev/tasks/ProcessJobQueueTask and the Lucene index is regenerated. This stops the error occurring for both CMS actions and searches.
However, a couple of weeks later, and the errors will start appearing again. Albeit with a different .cfs filename. After running the tasks everything works fine for a couple of weeks and so on.
It seems to happen to different sites at different times.
I don't believe this issue was triggered by a change to the site's code or a module update. So I'm guessing something has started happening on the cPanel server which breaks Lucene.
Anyone have any ideas?