silverstripe / silverstripe-fulltextsearch

Adds external full text search engine support to Silverstripe
BSD 3-Clause "New" or "Revised" License
44 stars 83 forks source link

Works fine on Dev, but on Prod many index files are missing and all owned by root (same database) #288

Closed muppsy007 closed 4 years ago

muppsy007 commented 4 years ago

This is an odd one, as the module and solr search setup has worked for over a year without issue. What I'm about to describe only occurred after I tried to reindex on Production yesterday.

Symptoms: After running Solr_Reindex, search from Silverstripe (Which has been working for a year and is unchanged) returns zero results. Meanwhile, the same search from the Solr admin direct returns results as expected. I have tried deleting .solr directory and running Solr_Configure again (followed by Solr_Reindex), with the same result.

I took a copy of the production database and attempted to replicate locally, but I could not. Search via Silverstripe behaves as expected.

Comparing the contents of .solr/MyIndex/data/index (between working Dev and non-working Production) provides a hint. On Dev, the contents of the index are all owned by the web user. While the contents of index on Production is owned by root. Additionally, Production is missing a large number of files that Dev has (remembering they are both using the same database). Local has around 56 files in the index directory, Production has around 12.

Any idea what might be causing the data directory to be written by root? I am running both Solr_Configure and Solr_Reindex from the browser. The permissions seem to be getting set by Solr_Configure.