'Index Search Engine' perpetually running

Permalink 1 user found helpful
Index Search Engine doesn't want to stop running (or appears to continue running) in the Dashboard.

I know I can edit 'jStatus' in the jobs table of the database & set to ENABLED, but I want to be certain the job is actually running.

If I do start it running again, it appears to run, and run, and run... What's up with that?

invision
 
Mnkras replied on at Permalink Reply
Mnkras
about how many pages does the site have
invision replied on at Permalink Reply
invision
Around 120 pages.
Mnkras replied on at Permalink Reply
Mnkras
In your dashboard, go to jobs, copy the url and add &force=1 to the end

On Feb 10, 2011 8:12 AM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
TheRealSean replied on at Permalink Reply
TheRealSean
Thats done it thanks Mnkras
invision replied on at Permalink Reply
invision
Tried this, but the index continues to run.
cannonf700 replied on at Permalink Reply
cannonf700
I have the same problem!
If I try to run the automated script:
http://www.yoursite.com/index.php/tools/required/jobs?auth=bc8e22ae...

I get this error message:

Fatal error: Call to a member function getInstance() on a non-object in /home/rynomed1/public_html/yoursite.com/updates/concrete5.4.1.1/concrete/libraries/database_indexed_search.php on line 137

Any Ideas?
Steevb replied on at Permalink Reply
Steevb
Hey,

Got the same problem?

First of all my was down with this:
An unexpected error occurred.
mysql error: [1: Can't create/write to file '/tmp/#sql_20e8_0.MYD' (Errcode: 17)] in EXECUTE("SHOW COLUMNS FROM `btNavigation`")

Repaired a bit through cPanel.

Got my site back, went back to maintenance got this;

Currently Running (Since 3:52:03 PM) - 30.3.11

Index updated. 14 pages required reindexing.

It is now 4.20 pm - 31.3.11?

Tried URL, got this;

/public_html/concrete/libraries/database_indexed_search.php on line 137


What's happening?
edward replied on at Permalink Best Answer Reply
Well, what is happening in your case is that the indexing process is not actually running anymore. On the other hand, PHP has died with a fatal error before it could finish the indexing, and therefore it still appears as 'running' (it never closed properly).

The reason for this is a BUG in concrete5. I had the exact same symptoms and the exact same error at the exact same line, and I managed to fix it.

What you need to do is this:

1. Open '/concrete/libraries/database_indexed_search.php', and go to line 137. It reads as follows:

$b = Block::getByID($row['bID'], $c, $row['arHandle']);
$bi = $b->getInstance();
if (!is_object($b)) {
   continue;
}
if(method_exists($bi,'getSearchableContent')){
   $searchableContent = $bi->getSearchableContent();


The part we're interested in, and where the error occurs, is '$bi = $b->getInstance();'. It fails if '$b' is NULL or not an object. There is actually a check in place to prevent this failure, but it is misplaced - it should be BEFORE the error line, not AFTER.

Anyway, the fix is easy: we move the line '$bi = $b->getInstance();' three lines down. The code now reads as follows:

$b = Block::getByID($row['bID'], $c, $row['arHandle']);
if (!is_object($b)) {
   continue;
}
$bi = $b->getInstance();
if(method_exists($bi,'getSearchableContent')){
   $searchableContent = $bi->getSearchableContent();


If you now re-run your job, it will actually finish.

If anyone from the C5 team is actually reading this, please fix it! Thanks :)
bjalexander replied on at Permalink Reply
bjalexander
An hour and a half of (frustrated) looking and I finally found your answer. Perfect fix. Thank you.
mgraves10 replied on at Permalink Reply
invision: Thanks for bringing this issue up, I was having the same problem. I've noticed a few other threads about this, you should mark this thread as solved so others will know there's an answer in here. :)
TheRealSean replied on at Permalink Reply
TheRealSean
Best answer has been marked :), also helps to mark the thread as helpful
TheRealSean replied on at Permalink Reply
TheRealSean
Its also worth noting this has been fixed in 5.5