View Full Version : phpBB bug

Gnat B
03-16-2004, 09:39 PM
The forums on my site have been running beautifully for months, then suddenly this:


Couldn't obtain category list.


SQL Error : 1030 Got error 127 from table handler

SELECT c.cat_id, c.cat_title, c.cat_order FROM phpbb_categories c, phpbb_forums f WHERE f.cat_id = c.cat_id GROUP BY c.cat_id, c.cat_title, c.cat_order ORDER BY c.cat_order

Line : 120
File : /var/www/html/womby/includes/functions.php

Any ideas how I can fix this table?

Thanks so much in advance.

03-17-2004, 07:28 AM
Just checked your link and it looks like you are working on it maybe at the moment.

Have you installed any mods on the board of late or is it a default install of the board?

I do know that phpBB just released an upgrade for the board that has security fixes in it and it may be West Host has applied the upgrades to your board. The drawback of this if you have installed any mods is that it could cause some problems. I'll do some checking on the error you listed but if you could let us know if you have any mods installed that may help.

03-17-2004, 07:44 AM
Did some checking and if you have not installed any mods the area that the board failed was within the function make_jumpbox. I don't think this function should not be called on index.php.

Something you can do is check the phpbb_categories table using phpMyAdmin to make sure that it is there and that all the structer is still correct.

WestHost - MMellor
03-17-2004, 09:05 AM
Gnat B,

The code that you have written looks to be fine. The only thing that I can see is that you do need a ; at the end of the statement. You might have not just copied that in. The only other thing that I can think of is to make sure that the tables that you are calling from to exist and as WildJoker said the structure is correct. Keep us updated on how you are doing on this.

03-20-2004, 01:11 PM
The phpBB error outputs don't show the ; but it's there in the coding. I've been getting the same problems on my phpBB at http://www.broomsticksandowls.com/forum/ since around January - the same type of error message although different (random?) tables are involved each time (see examples at end of this post).

Warning - you may end up with totally garbled data if you follow any suggestions below.
Some times things can be fixed by:

repair table tablename

However, much of the time the table shows as "locked" in phpmyadmin, and the above command may have no affect, so I do the following:

flush tables

You may also need to to do:

repair table tablename

after flushing the tables.

However, with all the above, I often end up wth total garbage in the table involved so need to restore the table from backup.

At the moment this problem is happening almost daily, and in the last week, sometimes more than once a day. I've tried updating to phpBB2.0.7 (was using 2.0.6 before) but no change - still these problems. It's getting too much to handle - I'm spending all my time restoring and fixing.

I'm guessing it's not a phbBB bug but server-related (overloaded?) but who knows?

3 Example errors
Could not obtain vote data for this topic


SQL Error : 1015 Can't lock file (errno: 29)

SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result FROM vote_desc vd, vote_results vr WHERE vd.topic_id = 286 AND vr.vote_id = vd.vote_id ORDER BY vr.vote_option_id ASC

Line : 686
File : /var/www/html/wwwsites/broomsticksandowls/forum/viewtopic.php


Failed obtaining forum access control lists


SQL Error : 1030 Got error 29 from table handler

SELECT a.forum_id, a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate, a.auth_ban, a.auth_greencard, a.auth_bluecard, a.auth_mod FROM auth_access a, user_group ug WHERE ug.user_id = 745 AND ug.user_pending = 0 AND a.group_id = ug.group_id AND a.forum_id = 23

Line : 172
File : /var/www/html/wwwsites/broomsticksandowls/forum/includes/auth.php


Could not query private message post information


SQL Error : 1015 Can't lock file (errno: 29)

SELECT u.username AS username_1, u.user_id AS user_id_1, u2.username AS username_2, u2.user_id AS user_id_2, u.user_sig_bbcode_uid, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_avatar, pm.*, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text FROM privmsgs pm, privmsgs_text pmt, users u, users u2 WHERE pm.privmsgs_id = 10075 AND pmt.privmsgs_text_id = pm.privmsgs_id AND pm.privmsgs_from_userid = 341 AND pm.privmsgs_type = 2 AND u.user_id = pm.privmsgs_from_userid AND u2.user_id = pm.privmsgs_to_userid

Line : 248
File : /var/www/html/wwwsites/broomsticksandowls/forum/privmsg.php

03-20-2004, 01:54 PM
I think perhaps you are correct that it is not the php script that is at fault. I have updated some of mine to 2.07 using there files with no problems. I did just visit your broomsticksandowls board and you do have a big membership and tons of articles. Can you clean prune some of your users that have not validated and some of the old post? If it is a server load issue this could help. From what I can tell from the phpBB site the size of the database should not be an issue but there is alot to rumage through on thier site. Have you visited their forum to see if any users have mentioned the same problem? Wish I could give you an answer to the problem but maybe some of the above may help although it sounds as if you have tried just about everyting.

03-28-2004, 10:41 PM
Thanks for visiting the forum, wildjokerdesign. One of the forum areas is on autoprune but I don't really like to prune out other old stuff just because it's old. The forum would grow back anyway and quite often members resurrect old threads. Plus, as you have mentioned, I was also under the impression that phpBB scaled well. I've been having problems with the forum of one kind or another ever since I moved it to Westhost. It was on a very inexpensive standard shared server with another company up until September/October, and things were absolutely fine. As soon as I moved it to Westhost (consolidating my sites into the one westhost account), members started noticing extreme slowness (often stopping to a dead halt, thus making the forum virtually unusable). In January Westhost increased the max number of clients in the httpd.conf file and members noticed a remarked improvement in speed and acessibility. However, the "DEBUG MODE" errors started to become about once a week then. They seem to very often occur on thursdays/fridays (which makes me wonder if something else is happening on the server on those days?)

The week before last (when I posted above) it was almost a daily problem but in the past week it's only been twice. I'll be monitoring this more in the next few weeks.

I've tried searching on the phpBB forums for stuff on this - there are a quite a lot of posts mentioning it, and how to fix it using the repair command, but nothing solid that I can find which explains exactly why this should happen out-of-the-blue.

By the way, there has just been a security problem identified and 2.0.8 is now available - if anyone is using an old version it's best to update. :-)

03-29-2004, 07:12 AM
I just went through and did a optimization on all my tables via phpMyAdmin and it seemed to help some. I also ran repair on them for good mesure. Did the update to 2.08 at the same time. I been spending alot of time updateing phpBB lately with the amount of changes they have been makeing. :)

04-04-2004, 09:16 AM
Good idea about the optimizing all tables. I tried this on Wednesday. No crashes so far. :-)

04-04-2004, 09:21 AM
Glad that worked for you. I first did it because I noticed that the 'overhead' was showing up on some tables. I figure I'll keep my eye on it to see how often it needs to be done. Imagine it depends on how busy the forum is.

Keith Larman
04-28-2004, 08:27 PM
Well, if it is any consolation, I have been having similar sporadic errors on a board I run.


The board is plain vanilla with the exception of the spell checker mod. And that was installed and running for months before any errors occured. But I get the exact same sporadic errors shutting the board down. Just fixed one a few minutes ago. Here's the error.

Could not query new topic information


SQL Error : 1030 Got error 29 from table handler

SELECT t.forum_id, t.topic_id, p.post_time FROM phpbb_topics t, phpbb_posts p WHERE p.post_id = t.topic_last_post_id AND p.post_time > 1083204851 AND t.topic_moved_id = 0

Line : 192
File : /var/www/html/phpBB2/index.php


So same basic problem. Repair all tables fixes the problem, but it is getting *very* old having this occur now about 5 times in the last few days. I've repaired all, optimized all the tables and while the board comes back on-line, it tends to go to hell in a handbasket a day or two later.

I did have one time it happened when a particular user told me his account and all his posts had vanished after a crash. I don't know if the repairing tables caused him to go bye-bye, or if for some reason it was his account and his post that created the problem, but he was gone as were his posts.

This weekend I'll be upgrading the BBS to the latest version. Worse comes to worst and I'll go to a totally plain vanilla install and just kill spell check mod. I've reported this a couple times in bug reports. And while westhost has been helpful initially about repairing tables and once restoring from a backup they had after the thing lost a whole lot of content, I've not had an explanation as to why this is happening.

04-29-2004, 08:26 AM
It may be that upgrading to 2.08 well take care of your problem. Most all the changes have been for security or to optimize some things in the script. If you have html turned on for your board you might think about turning off. There was a snag with that at one time with the script although I think they have it fixed with 2.08. I don't think that the spell check should be affecting it and I don't think any of the updated files change the files you modded for that. You might want to double check that before you update. There is a post where I have detailed the upgrade from 2.05 to 2.08 both on this board and on mine listed in my sig. It is pretty easy with a vanilla board still using SubSilver. Only one template file is altered which is the on for your index.php page.

Keith Larman
04-29-2004, 09:17 AM
Thanks, I'll take a look for your posts. Best I can tell there aren't any gotchas to the spelling mod, so it should be a quick update. But something has been futzing up the SQL databases in the last few months. And this was with *NO* changes to anything from my end and the board had been running very well for months previously. As in zero problems. And the board is very low activity.

I would understand if I had installed something, changed something, done something. But nope... Running fine then suddenly not. I keep wondering if there was something added/removed/changed on Westhost's side of things that introduced a subtle issue. I know there have been things like that in the past with mySQL.

04-29-2004, 10:06 AM
I think there there may be something on the WestHost side but not sure if there is anything we can do about it from our end right now. I know they are working on optimizeing some things and I do keep looking to see if there is maybe some setteing that could be changed at our level that could help.

It is true that if you compare the speed and reaction of the WH board with that of ones on user accounts there can be a noticable difference. Today on checking all my boards they seem sluggish and I am getting some errors upon posting with some of them. I do have to say that almost all the boards I work with are very heavily modded. It can be hard to tell at times if it is something at the WH server end or something at my end with my ISP. (They are not always the most reliable :) )

If we all keep searching we may find something.

Keith Larman
04-29-2004, 10:16 AM
One thing I had to do with this board is switch over to IP-based. For some reason being on name-based the thing was *deathly* slow, but only sporadically. There would be *NO ONE* on the board but me early on and it was still sometimes slogging along sometimes even timing out. Then other times I'd have 10 guys logged in, posting, searching, doing stuff and it was lightening fast.

And it is a bit jarring to come here and find this board running really quickly. So obviously its possible... ;) And I've yet to come here and get a debug mode message... What are the differences?

04-29-2004, 11:21 AM
Maybe try turning on MySQL logging? It may give some clue as to what is happening.
You can also get PHP to log to a file so that you have a record of what errors are occuring without relying on your users reporting them.


Keith Larman
04-29-2004, 02:04 PM
Good (and what should have been obvious to me) suggestion. My whining about this is that it is one of those things I do for next to nothing or this client and I'd really not spend more time than I'd have to. So it is annoying that something so "vanilla" should be such a time-eating enterprise. Anyway, I've turned on the logging and we'll see what happens next time. And once I free up some time, I'll do the upgrade to the latest phpbb2 code.

Of course this will teach me not to assume something even this plain vanilla won't create more work than I'd like... :(