My case of "can't insert new word match" problem

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Zemog
Registered User
Posts: 22
Joined: Thu Apr 18, 2002 11:47 am
Location: Mexicali, B.C. México

My case of "can't insert new word match" problem

Post by Zemog »

My board had the general error: "can't insert new word match."

After searching within this forum with a solution, I checked my board's database with Myadmin and found that there was a table (phpbb_search_wordmatch) marked as "in use".

Given the fact that the board was disabled I certainly knew that that could not be posible so something was wrong.

I called my ISP and the tech support guy (very helpful and cooperative) couldn't find anything wrong or open connections to the database. He even reloaded the runnning processes to rule out any corrupt session (or something like that). Then he noticed that the file corresponding to the mentioned table was simply not there.

Perhaps when someone was making a post the connection got broken and somehow corrupted the table, we don't really know what happened, it is pure speculation.

So the "solution" was to drop the table and create it again. It worked, but I now have an empty table.

I would like to "refill" the table with whatever was there, so I would really appreciate if someone could guide me to whatever needs to be done to accomplish that.

I think that it may be possible to scan all of the posts and replenish that table again. I will try to look at the code and figure it out. But any help would be great.

Thanks in advance
Zemog
Registered User
Posts: 22
Joined: Thu Apr 18, 2002 11:47 am
Location: Mexicali, B.C. México

Post by Zemog »

Ok, my problem is solved, I took me some time to figure everything out, but here is the story.

NOTE: Don't try it if you're unsure about what you're doing.
Please also note that this solved MY case, it may not be same as yours. So please use common sense and read the first post of this topic to determine if your case is similar to mine


Below are the steps I took to solve my "can't insert new word matches" error, you may try them if your problem is similar to mine

You'll have to alter the database by yourself, so please make sure you're comfortable doing such things. Also make sure you have available an utility to do so, such as myadmin. And follow the golden rule of backing up anything before you modify it.
  1. Disable the board to prevent usage.
  2. Drop the phpbb_search_wordmatch table
  3. Create the table again (using the appropiate portion of the schema file of your database provided with phpbb)
  4. Backup your database (either from the included admin panel option or using another utility).
  5. Empty the phpbb_search_wordlist table
  6. Backup the file upgrade.php (if it is not there you need to upload it again)
  7. Open upgrade.php and around line 38 find:

    Code: Select all

    	if( defined("PHPBB_INSTALLED") )
    	{
    		header("Location: index.$phpEx");
    		exit;
    	}
    	}
    
    and change it to:

    Code: Select all

    /*	if( defined("PHPBB_INSTALLED") )
    	{
    		header("Location: index.$phpEx");
    		exit;
    	} */
    	}
    
  8. Around line 392 find:

    Code: Select all

    print "<hr /><a href=\"$PHP_SELF?next=$next\">Next step: <b>$next</b></a><br /><br />\n";
    
    and change it to:

    Code: Select all

    print "<hr /><a href=\"$PHP_SELF?next=$next\">Next step: <b>$next</b></a><br /><br />\n";
    die();
    
  9. Open your browser and type this in the address bar. (change to your url and dir)

    Code: Select all

    http://www.sitename.com/phpBB/upgrade.php?next=fulltext_search_indexing
    
    The script will show an error message regarding the smilies database, you can safely ignore it and take a look below that, you'll see that the script is processing batches of posts with messages like:
    * Fulltext Indexing ( 1 to 150 ).........OK
    * Fulltext Indexing ( 151 to 300 ).........OK
    and so on...

    Wait until it finishes, it may take a long time, depending on the number of posts you have.
  10. When the script finishes it will display: "Next step: update_topics"
    DON'T CLICK ON IT. At this point you should close your browser because you're done.
  11. Backup the database again and keep it in a safe place ;)
  12. Restore your upgrade.php (or delete it if it originally wasn't there)
  13. Enable your board again thru the admin panel
There!, that should get both tables up and running smoothly.

Please note that the above steps are for RECOVERY only and in no way are meant to prevent the problem from showing up again. If it does happens again, then there's a problem somewhere that needs to be fixed, and that's beyond the scope of this topic and my knowledge.

I hope this helps someone to recover from their problem.
jbay
Registered User
Posts: 18
Joined: Tue Apr 02, 2002 2:27 pm
Contact:

Post by jbay »

I've had numerous problems (not recently, knock on wood) with the search_words* tables. I've discovered they can be repaired in phpMyAdmin if you have access to it -- even if they're marked as "in use", go to a table where you can get the dialog (sql query) box to show, and enter "repair table phpbb_search_wordlist" or "repair table phpbb_search_wordmatch" as required. So far it has worked for me (before I figured that out, I was dropping the table like you are, and just letting it re-populate itself as new posts were added -- but the repair method is faster).

I think the root of the cause may be mysql crashing as tables are being updated under heavy loads. Our ISP upped the # of max connections to the database, and that seems to have helped.
User avatar
Quuipo
Registered User
Posts: 191
Joined: Sun May 05, 2002 8:15 pm

Post by Quuipo »

Zemog, you deserve a medail for this!

thank you so much for your step to step explanation. I had this error totally unexpected and with your help i could solve it in no time!
Locked

Return to “2.0.x Support Forum”