Forum is frozen. Infinite sql loop while post/edit/modify/save

Started by Maxtor, April 13, 2013, 10:33:34 PM

Previous topic - Next topic

Maxtor

Forum saddently frozen. there is Infinite sql loop while post/edit/modify/save big topics or some profiles.

after the problem occur i have done a restart to httpd, sql, nginx, repair database and checked error log. i cant find anything...

what could be the problem???

Arantor


Maxtor

Quote from: Arantor on April 13, 2013, 10:34:33 PM
How do you know it is an infinite loop, exactly?
I know because, once i press 'save button' in full edit mode, the php process goes to 99% cpu usage, and stays for that until the execute time limit is achived, then the process is aborted, and no error_log is generated.

Arantor

That's not an SQL loop then.

Does the edit actually occur? Is the edited version in the database or does it not save the changes?

Also, what mods installed?

Maxtor

QuoteThat's not an SQL loop then.

Does the edit actually occur? Is the edited version in the database or does it not save the changes?

Also, what mods installed?

no it times out without the edit actually done. the save never be made.

the mods i installed are:

Board-color-and-icons
Stop Spammer
SMF4Mobile Mod
SMF Trader System
Ad Managment
Country Flags
Profile Comments
Social Bookmarks
Users Online Today
Simple Award System
Global Headers Footers
Hide Tag Special
Advanced Topic Prefix Mod
SimpleColorizer
SMFShop
httpBL
Hide Post
Karma Description Mod
Aeva ~ Auto-Embed Video & Audio




also i just noticed these errors:


[Sat Apr 13 19:13:37 2013] [warn] [client 94.69.93.234] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 352, referer: http://***.com/forum/index.php?action=post;msg=2495914;topic=268125.0
[Sat Apr 13 19:13:37 2013] [warn] [client 94.69.93.234] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 351, referer: http://***.com/forum/index.php?action=post;msg=2495914;topic=268125.0
[Sat Apr 13 19:13:37 2013] [warn] [client 94.69.93.234] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 348, referer: http://***.com/forum/index.php?action=post;msg=2495914;topic=268125.0
[Sat Apr 13 19:13:37 2013] [warn] [client 94.69.93.234] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 347, referer: http://***.com/forum/index.php?action=post;msg=2495914;topic=268125.0
[Sat Apr 13 19:13:37 2013] [warn] [client 94.69.93.234] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 346, referer: http://***.com/forum/index.php?action=post;msg=2495914;topic=268125.0


and this:

[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 353, referer: http://***.com/forum/index.php?action=profile;area=forumprofile
[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 352, referer: http://***.com/forum/index.php?action=profile;area=forumprofile
[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 351, referer: http://***.com/forum/index.php?action=profile;area=forumprofile
[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 348, referer: http://***.com/forum/index.php?action=profile;area=forumprofile
[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 347, referer: http://***.com/forum/index.php?action=profile;area=forumprofile
[Sat Apr 13 19:35:34 2013] [warn] [client 41.46.68.148] mod_fcgid: stderr: PHP Warning:  Cannot modify header information - headers already sent in /usr/home/maxtor99/public_html/forum/Sources/Errors.php on line 346, referer: http://***.com/forum/index.php?action=profile;area=forumprofile

Arantor

I think the next step is to attach Sources/Post.php and Sources/Subs-Post.php

Maxtor

here they are.
also i saw this but im not sure if its related :

PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 7 in /usr/home/maxtor99/public_html/forum/Sources/Subs-Post.php on line 1279

Arantor

Well, that particular line is during the conversion for email purposes.

That would suggest that there's notifications going on and there's a lot of notifications.

Why it's throwing an error, I don't know, that line appears to be the same as a raw 2.0.4... makes me sort of wonder whether your system is proper UTF-8 or not.

HYPERFILTER

He is probably not around anymore, but I will add something useful :

When he try to edit a post (not all of them, just some of them are causing this 'looping issue'), in quick edit mode, by using 'google chrome developers tools', we can see
that the web server is returning the following html output :


<div id="fatal_error">
  <div class="cat_bar">
   <h3 class="catbg">
    An Error Has Occurred!
   </h3>
  </div>
  <div class="windowbg">
   <span class="topslice"><span></span></span>
   <div class="padding">The board you specified doesn't exist</div>
   <span class="botslice"><span></span></span>
  </div>
</div>
<div class="centertext"><a href="javascript:history.go(-1)">Back</a></div>


Not sure if this will help you or not, knowing what could be the reason of that problem, but here is it.

Arantor

So it's not all posts? Is there anything consistent about the ones that do?

Maxtor

Quote from: Arantor on April 13, 2013, 11:10:22 PM
So it's not all posts? Is there anything consistent about the ones that do?

all the "big" topics and posts are causing problem.

HYPERFILTER

Not really, the only thing that matters is the topic size, all them are 'big' compared to the ones which are still editable, but I guess, the topic size is not the issue.

As some profiles can't be edited too... but not all of them.

Arantor

maxtor: Are you using MyISAM or InnoDB for your tables (in particular the messages table)?

HYPERFILTER

Quote from: Arantor on April 13, 2013, 11:15:20 PM
maxtor: Are you using MyISAM or InnoDB for your tables (in particular the messages table)?

MyISAM (for messages table), but other tables are also InnoDB...

Maxtor

Quote from: Arantor on April 13, 2013, 11:15:20 PM
maxtor: Are you using MyISAM or InnoDB for your tables (in particular the messages table)?
messages are MyISAM but some tables are innodb.

Arantor

I'd love to know why messages is still MyISAM since it's quite possibly a contributing factor.

See, MyISAM is full table locking. Any changes to the table require the entire table to be locked, preventing any other access. For small forums, this isn't a problem. But large changes... like editing a post, are a problem.

You should convert it to InnoDB and make sure the buffers are suitably large.

HYPERFILTER

Quote from: Arantor on April 13, 2013, 11:21:02 PM
I'd love to know why messages is still MyISAM since it's quite possibly a contributing factor.

See, MyISAM is full table locking. Any changes to the table require the entire table to be locked, preventing any other access. For small forums, this isn't a problem. But large changes... like editing a post, are a problem.

You should convert it to InnoDB and make sure the buffers are suitably large.

But why the forum would work like this for the last 7 years, with 2 millions of post, and suddenly it would start having this behavior ?

I guess MyISAM wouldn't be the issue here (just a guess tho?)

Even if the locking issues were the problem, still it would be possible to edit the post, also looking MYSQL Process List, there are no locks acquired for this table...

Arantor

There's quite literally thousands of possible factors involved.

I'm just trying to nail down the most likely candidates. You have errors where there shouldn't be errors (see other unanswered question regarding UTF-8), it's entirely possible - even likely - that that is a contributing factor too.

I doubt this is entirely a 'sudden' thing. Just that it was happening before, only it was small enough periods of time that you wouldn't have noticed it.

QuoteI guess MyISAM wouldn't be the issue here (just a guess tho?)

*shrug* It might be. There's many different factors involved.

HYPERFILTER

Quote from: Arantor on April 13, 2013, 11:25:57 PM
There's quite literally thousands of possible factors involved.

I'm just trying to nail down the most likely candidates. You have errors where there shouldn't be errors (see other unanswered question regarding UTF-8), it's entirely possible - even likely - that that is a contributing factor too.

I doubt this is entirely a 'sudden' thing. Just that it was happening before, only it was small enough periods of time that you wouldn't have noticed it.

QuoteI guess MyISAM wouldn't be the issue here (just a guess tho?)

*shrug* It might be. There's many different factors involved.

I am not doubting your opinion, it is valid, since you are a developer here of course.

The question just come to me, because nobody had noticed anything similar in the last month, and then suddenly many members started complaining about these issues... which looked kinda strange.

Arantor

It's a valid question.

But look at it this way: nothing else, apparently, changed. No mods, no PHP upgrade. The *only* thing that's changed is the data - there's more of it.

From what I've seen thus far, the only logical conclusion is that you're going over limits you weren't going over before. But seriously, there is absolutely no good reason to be using MyISAM on the messages table.

Advertisement: