Topic: Error: Unable to fetch search index word match

Hi,

I'm using PunBB 1.15 on one of my band's website (http://www.elephantband.com) and it's been working fine for the last 5 or 6 months.  All of a sudden, when posting something new or trying to delete an existing topic, I get this error:

"Unable to fetch search index word match."

What's weird though, is that if you go back to the forum index, and hit Refresh or F5, the action was successful.  It seems like it's just in trying to redirect you to the index page of the forum that it fails.

Anyone have any ideas???  I haven't changed anything since the install and this just started a few days ago.  Is it possible my hosting company changed something on the server which could have had an impact on the forum?

Any help is greatly appreciated.

Thanks,
Randy.

Re: Error: Unable to fetch search index word match

Enable Debug Mode and tell us what it says

3 (edited by barcode 2004-12-11 21:30)

Re: Error: Unable to fetch search index word match

Hey,

Thanks for the quick reply... Here's what it says:


File: /hsphere/local/home/barcoder/elephantband.com/EleFanForum/include/search_idx.php
Line: 176

PunBB reported: Unable to insert search index word matches
Database reported: Can't open file: 'search_matches.MYI'. (errno: 145) (Errno: 1016)

Here's the query on line 176:

$db->query('INSERT INTO '.$db->prefix.'search_matches (post_id, word_id, subject_match) SELECT '.$post_id.', id, '.$subject_match.' FROM '.$db->prefix.'search_words WHERE word IN('.implode(',', preg_replace('#^(.*)$#', '\'\1\'', $wordlist)).')') or error('Unable to insert search index word matches', __FILE__, __LINE__, $db->error());

Let me know.

Thanks,
Randy.

Re: Error: Unable to fetch search index word match

And I just tried deleting a post, to see if I'd get the same message, and this is what happened:

File: /hsphere/local/home/barcoder/elephantband.com/EleFanForum/include/search_idx.php
Line: 194

PunBB reported: Unable to fetch search index word match
Database reported: Can't open file: 'search_matches.MYI'. (errno: 145) (Errno: 1016)

It's an error with the same database file, but on a different query.

Here's the query on line 194:

$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());

Thanks again,
Randy.

Re: Error: Unable to fetch search index word match

A similar problem occurs when you try to search. My guess is that it's a crashed table though. Do you have phpMyAdmin or some other database administration tool? In that case, use it to repair the tables search_matches and search_words.

Edit: Yes. "MySQL error:  145 = Table was marked as crashed and should be repaired"

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error: Unable to fetch search index word match

Hey Rickard,

Perfect... That worked like a charm!  Thanks alot!

I used phpMyAdmin and executed the following SQL:

REPAIR TABLE search_matches
REPAIR TABLE search_words

I tested the functionality and everything seems to be working ok.

Thanks to everyone for helping resolve this so quickly.

Take care,
Randy.

7 (edited by Frank H 2004-12-11 22:21)

Re: Error: Unable to fetch search index word match

Rickard wrote:

A similar problem occurs when you try to search. My guess is that it's a crashed table though. Do you have phpMyAdmin or some other database administration tool? In that case, use it to repair the tables search_matches and search_words.

Edit: Yes. "MySQL error:  145 = Table was marked as crashed and should be repaired"

perhaps worth adding it(optimize + repair) into the "maintenence" admin interface?  (and that mods can add tables to that list aswell)?

the PM mod probably need quite abit of optimize (as msgs are deleted) ... and the attachment mod will probably need it aswell if one delete alot of files ...

Re: Error: Unable to fetch search index word match

the db management plugin i made has a optimize all and repair all tables, it just does it to all tables in the database

Re: Error: Unable to fetch search index word match

neat

Re: Error: Unable to fetch search index word match

i'm thinking of adding a table list with a % optimised column and per table optimse and repair buttons, but it might be more effort than its worth