Support Forum

Sferrorlog table

MR Marco Rossi
Marco Rossi
Member

Hi all,

may be I’m unlucky because I made a search with “sferrorlog” and only one result with similar issue.

My sferrorlog table is filled with a rhythm of 10/20 records per second, so I ask a hand.

I attach a shortened part of content (made a dump and cut) so you can see records, time and type, at least part of them, I hope that this helps to find a solution.

When this log was filled only two users were on forum, me and another admin.

What I’d like, apart understand and repair what is wrong, is to avoid that this table be filled.

My hoster put in stand by the db if across 100k queries per hour so I have to avoid, even if one or more errors are present, to write so many queries in any case, error or not because I prefer to maintain the forum active instead to fill db with so many queries and Mb.

How can I block this process or, at least, limit queries to a defined number? (let say 100 per hour)

I had to deactivate the forum until this problem is solved.

Thanks in advance for assistance

Marco

17 Answers

New Answer

BR Brandon
Brandon
Member

You are getting a lot of Object not found messages. You must be running php 5.4. That is something they just changed/added. It doesn’t cause any issues except note it in. Do you have a choice of which php version you can run? Maybe go back to 5.3 until a new SP update comes out?

MR Marco Rossi
Marco Rossi
Member

Hi Brandon,

if is that simple, of course I can :)

You’re right, I run PHP 5.4 and for sure can switch to 5.3 and wait. 

Thanks a lot for so quick assistance :)

Marco

MR Marco Rossi
Marco Rossi
Member

I did, I had to wait that PHP downgrade but now when reactivate SP it breaks all and shows me only a white page, no administration at all.

Can access to admin only renaming via FTP the SP folder so this deactivate the plugin and admin panel can work.

I tried three time and the same behavior.

Any idea?

MP Mr Papa
Mr Papa
Member

sounds like a problem downgrading??  sp and wp only needs 5.1..

If you would rather make a few simple code changes to the 5.1.4 you have, you can fix the majority of the stupid php 5.4 warning chagne…  from : to format…  basically, adding $var = new stdClass(); to init object…  few others, but this is key ones and you would know how to make the others… ;)

 

/trunk/forum/content/sp-common-view-functions.php
413,7 → 413,7
# make sure we are displaying avatars
$spAvatars = sp_get_option(‘sfavatars’);
if ($spAvatars[‘sfshowavatars’] == true) {
$avatarData = ”;
$avatarData = new stdClass();
$avatarData->object = false;
$avatarData->userId = 0; # need user id OR email
$avatarData->email = ”;
/trunk/forum/content/classes/sp-topic-view-class.php
238,6 → 238,7
$this->topicViewStatus = ‘data’;
 
# construct the parent topic object
$t[$tidx] = new stdClass();
$t[$tidx]->topic_id = $r->topic_id;
$t[$tidx]->forum_id = $r->forum_id;
$t[$tidx]->topic_name = sp_filter_title_display($r->topic_name);
276,6 → 277,7
$pinned = 0;
foreach ($records as $r) {
$pidx = $r->post_id;
$t[$tidx]->posts[$pidx] = new stdClass();
$t[$tidx]->posts[$pidx]->post_id = $r->post_id;
$t[$tidx]->posts[$pidx]->post_date = $r->post_date;
$t[$tidx]->posts[$pidx]->user_id = $r->user_id;
360,6 → 362,7
$edits = unserialize($r->post_edit);
$eidx = 0;
foreach ($edits as $e) {
$t[$tidx]->posts[$pidx]->edits[$eidx] = new stdClass();
$t[$tidx]->posts[$pidx]->edits[$eidx]->by = $e[‘by’];
$t[$tidx]->posts[$pidx]->edits[$eidx]->at = $e[‘at’];
$eidx++;
/trunk/forum/content/classes/sp-list-topic-class.php
205,6 → 205,7
 
if ($show) {
$t = $r->topic_id;
$list[$t] = new stdClass();
$list[$t]->forum_id = $r->forum_id;
$list[$t]->forum_name = sp_filter_title_display($r->forum_name);
$list[$t]->forum_permalink = sp_build_url($r->forum_slug, ”, 1, 0);
324,6 → 325,7
foreach ($postrecords as $p) {
if ($p->topic_id != $cTopic) {
$cTopic = $p->topic_id;
$newList[$cTopic] = new stdClass();
$newList[$cTopic]->topic_id = $cTopic;
$newList[$cTopic]->new_post_count = $p->new_post_count;
$newList[$cTopic]->new_post_post_id = $p->post_id;
359,6 → 361,7
if($postrecords) {
foreach ($postrecords as $p) {
$cTopic = $p->topic_id;
$first[$cTopic] = new stdClass();
$first[$cTopic]->topic_id = $cTopic;
$first[$cTopic]->post_id = $p->post_id;
$first[$cTopic]->post_date = $p->post_date;
/trunk/forum/content/classes/sp-forum-view-class.php
318,6 → 318,7
 
# construct the parent forum object
$r = current($records);
$f[$fidx] = new stdClass();
$f[$fidx]->forum_id = $r->forum_id;
$f[$fidx]->forum_slug = $r->forum_slug;
$f[$fidx]->forum_name = sp_filter_title_display($r->forum_name);
347,6 → 348,7
foreach ($records as $r) {
$tidx = $r->topic_id;
$t[] = $tidx;
$f[$fidx]->topics[$tidx] = new stdClass();
$f[$fidx]->topics[$tidx]->topic_id = $r->topic_id;
$f[$fidx]->topics[$tidx]->topic_slug = $r->topic_slug;
$f[$fidx]->topics[$tidx]->topic_name = sp_filter_title_display($r->topic_name);
/trunk/forum/content/classes/sp-group-view-class.php
265,6 → 265,7
$this->groupViewStatus = ‘data’;
$gidx = $groupid;
$fidx = 0;
$g[$gidx] = new stdClass();
$g[$gidx]->group_id = $r->group_id;
$g[$gidx]->group_name = sp_filter_title_display($r->group_name);
$g[$gidx]->group_desc = sp_filter_title_display($r->group_desc);
311,6 → 312,7
# it’s a top level forum
$subPostId=0;
$fidx = $forumid;
$g[$gidx]->forums[$fidx] = new stdClass();
$g[$gidx]->forums[$fidx]->forum_id = $r->forum_id;
$g[$gidx]->forums[$fidx]->forum_id_sub = 0;
$g[$gidx]->forums[$fidx]->forum_name = sp_filter_title_display($r->forum_name);
MR Marco Rossi
Marco Rossi
Member

Hi Steve,

what is this? have to change the code in 5 files? and after SP will work with PHP 5.3 or 5.4? by now it’s running 5.3 as per Brandon advice. What I have to do?

Actually, I don’t need to experiment, need a quick solution as site is online now.

Please, explain me steps and, if should be possible, as I’m abroad and out of office, could you, please, attach the whole file to substitute, as I have problem to make modifies in this moment,

Thanks in advance

Marco

MP Mr Papa
Mr Papa
Member

those are the code changes coming in the next version of SP to handle the new php 5.4 way of dealing with objects…  if you made those code changes, you could go back to php 5.4…

I am afraid not much I can do to help debug php 5.3 on your server – you would need to talk to your host…

experiment???  who said anything about an experiment??  Those code changes are already in the next development version of simple press which is already running on our site here… so definitely not experimental… 

but I cannot just send you the files either as they may have additional changes for the next version that wont work with the other files you have in the current simple press version…  If I get a chance tonight, perhaps I can create a new file from the current release version…  sorry, from the discussions I had just thought you might be up to a handful of code changes…

MR Marco Rossi
Marco Rossi
Member

Hi Steve,

may be I didn’t express myself well, with experiments I mean that on my case I’ll test code that isn’t shared, yet.

Anyway, I cannot make these changes now, I’m in a Starbucks coffee :) I’ll do tomorrow and if before that time you’ll have a public fix will be welcome, if not, I modify, go back to 5.4 and test, hope all goes well.

Anyway, just in case, there is a method to avoid to register all errors log?

Thanks

Marco

MP Mr Papa
Mr Papa
Member

http://stackoverflow.com/questions/8519775/turn-off-errors-in-php-display-errors-and-error-reporting

you want to turn off the php option in your php.ini to log errors…

MR Marco Rossi
Marco Rossi
Member

Hi Steve,

we are almost there…

I made all your modifies and almost all errors are disappeareds, need only some finetune to be complete, I think.

These are what reported in sferrorlog after modified files:

(1261, '2012-10-18 15:14:55', 'php', 'file: /simple-press/forum/database/sp-db-statistics.php<br />line: 163<br />function: sp_get_stats_counts<br />Warning | Creating default object from empty value'),
(1262, '2012-10-18 15:14:56', 'database', 'file: /path/to/wp/installation/wp-content/plugins/simple-press/sp-api/sp-api-primitives.php<br />line: 312<br />function: sp_update_sfmeta<br />error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''s birthdays and upcoming birthdays.</p>n        <p>Just download, install and ac'' at line 4<br /><br />UPDATE sim_sfmeta SETrn             meta_type=''news'',rn             meta_key=''news'',rn             meta_value=''a:3:{s:2:"id";s:1:"4";s:4:"show";i:1;s:4:"news";s:639:"n        n        <h4><b>New - Post Thanks and Birthdays Plugins Released</b></problem-with-post-edit-button4>n        <p>Now available to download - the Birthdays plugin for your Simple:Press forum.</p>n        <p><b>Post Thanks</b>: Allows your users to give thanks to post authors for good post and includes a points/reputation system.</p>n        <p><b>Birthdays</b>: Allows your users to enter birtdate info in their profile and for you forum to show Today''s birthdays and upcoming birthdays.</p>n        <p>Just download, install and activate. Available on our <a href="https://simple-press.com/download-plugins/">Plugins Download Page</a>.</p>n        n        ";}'',rn             autoload=0rn             WHERE meta_id=15'),
(1263, '2012-10-18 15:52:29', 'php', 'file: /simple-press/forum/database/sp-db-statistics.php<br />line: 163<br />function: sp_get_stats_counts<br />Warning | Creating default object from empty value'),
(1264, '2012-10-18 15:52:29', 'php', 'file: /simple-press/forum/database/sp-db-statistics.php<br />line: 163<br />function: Unavailable<br />Warning | Creating default object from empty value');

what to do in this case?

Thanks in advance

Marco

MP Mr Papa
Mr Papa
Member

the notice is irrelevant…

as I said earlier, you will run across some more of these stupid things caused by php 5.4 changes… we are fixing as they come up… next release will have the vast majority if not all fixed… if you want to fix them as you come across them, you can do manually.

line 162, in referenced file, change

    $cnt = ”;

to

    $cnt = new stdClass();

this will be a recurring theme…  php 5.4 now wants any object initialized with new stdClass()…

MR Marco Rossi
Marco Rossi
Member

Thanks Steve,

I see that this log about statistics are reset automatically time to time, so isn’t a big deal in any case.

What was a big problem was before because all those error logs was invalidationg the site.

Thanks a lot for your assistance

Marco

MR Marco Rossi
Marco Rossi
Member

Neverending story… :(

Now the most “trendy” message is:

file: /simple-press/forum/content/classes/sp-member-view-class.php<br />line: 307<br />function: sp_memberslist_query<br />Warning | Creating default object from empty value

again around 20 logs per second, but in forum only few visitor, by now, so some hundred of logs.

Any patch to fix also this one?

Thanks in advance

MR Marco Rossi
Marco Rossi
Member

I activated the admin bar (very useful) and added some error log, not too many, only FYI

file: -storage/path/to/wp-installation/wp-content/sp-resources/forum-plugins/admin-bar/library/sp-admin-bar-components.php<br />line: 229<br />function: sp_GetWaitingUrl<br />Warning | Creating default object from empty value