nqxcode / laravel-lucene-search

Laravel 4.2, 5.* package for full-text search over Eloquent models based on ZF2 Lucene.
73 stars 28 forks source link

Getting RuntimeException in Filesystem.php (line 55) #15

Closed agarwa13 closed 8 years ago

agarwa13 commented 9 years ago

I think I am doing everything just fine but I must be doing something wrong or perhaps it is incompatible with something I don't recognize. I wrote a stackoverflow post describing in detail the steps I took. Here is the link to it: http://stackoverflow.com/questions/32408994/laravel-5-1-laravel-lucene-search

Here is an image of the error:

capture

Can you please help me if you know what it might be or if you have come across this error in your own testing.

Cliffus commented 9 years ago

are you sure that for the lucene-search directory, the correct owner and group are set? By using ls -l, you get an overview of files and directories in a given directory, together with their owner and group settings. Maybe compare the settings of lucene-search with the ones already working.

Updating these settings can be done with the chown command (chown -R user:group directory_name)

agarwa13 commented 9 years ago

Now, I am super confused.

I ran ls -l and noticed that the lucene-search directory had root as owner and group. so I ran chown -R www-data:www-data lucene-search/ and it started working (sort of). The runtime exception went away but I get 0 results all the time. So I ran php artisan search:rebuild And the runtime error came back I ran ls -l again and the user and group was www-data as expected But I ran chown -R www-data:www-data lucene-search/ again (gut feeling) And the runtime error went away but of course I get 0 results again.

Any hints on what is going on?

Experiment 1: I ran: chmod -R 777 storage/app/lucene-search/

ls -l storage/app/ drwxrwxrwx 3 www-data www-data 4096 Sep 11 15:51 lucene-search ran php artisan search:rebuild -v Creating index for model: "App\Question" 584/584 [============================] 100% 53 secs Operation is fully complete!

Page shows runtime exception. Search::query('significant')->count()

ran chown -R www-data:www-data storage/app/lucene-search/

Page does not have runtime exception but returns 0 results on the following queries: Search::query('significant')->count(), Search::query('mass')->count(), Search::query('pulley')->count(), Search::query('vectors')->count(), Search::query('force')->count()

Image below shows some of the text in the database in the question model

screen shot 2015-09-11 at 1 06 49 pm
nqxcode commented 9 years ago

Please

  1. run chmod -R a+rw storage/app/lucene-search/
  2. run php artisan search:rebuild -v
  3. show output for ls -la storage/app/lucene-search/index
agarwa13 commented 9 years ago

capture

Here you go. Apologies for the delayed reply. I was travelling.

nqxcode commented 9 years ago

Try run any query in tinker, for example: sudo php artisan tinker > Search::query('significant')->count();

What result?

thxn commented 8 years ago

I'm having the same exact issue. After trying the steps above, running the command in tinker still returns 0 results.

cmoralesweb commented 8 years ago

If you are logged as root, the commands you run are executed as root, try this:

su -c 'php artisan search:rebuild --verbose' www-data