i've a big mysterious error in my forums for over a year and i might be getting to the end of the tunnel.
for every single page load of the forum (for every user), the smf error log shows things like this:
Quote
http://www.clubsonyericsson.com/forum/index.php?/topic,3290.msg14974.html
8: Undefined index: title
File: /home/cse/public_html/forum/Themes/forthemen3/index.template.php
Line: 680
http://www.clubsonyericsson.com/forum/index.php?/topic,3290.msg14974.html
8: Undefined index: href
File: /home/cse/public_html/forum/Themes/forthemen3/index.template.php
Line: 679
which of course is completely non-descriptive.
after checking with my server's technical service, who was able to dig in deeper, this is their reply.
Quote
After tracing the progress of php as it parses index.php it does look like it's trying to make a very large number of database calls to yabbse_log_errors in which apparently there's a duplicate entry. I believe you may need to contact the SMF developers for how to clear up this SMF database issue.
write(3, "\232\1\0\0\3\n\t\tINSERT INTO yabbse_log_errors(`id_member`, `log_time`, `ip`, `url`, `message`, `session`, `error_type`, `file`, `line`)\n\t\tVALUES\n\t\t\t(0, 1283802373, SUBSTRING(\'\', 1, 16), SUBSTRING(\'?\', 1, 65534), SUBSTRING(\'Error en la Base de Datos: Duplicate entry \\\'16777215\\\' for key 1\', 1, 65534), \'64cb14442b3ca2612786213a34186893\', \'database\', SUBSTRING(\'/home/cse/public_html/foro/Sources/Errors.php\', 1, 255), 150)", 414) = 414
It does this or something like it many tens of times and then eventually segfaults, probably due to memory use, but I can't tell for certain.
for stability reasons my server is only accessible to myself so i can't give you the link. i have two forums with this problem, and the one with the bigger database (+300mb) doesn't even load.
any ideas are more than welcome!
thank you
When you want to attach the file /home/cse/public_html/forum/Themes/forthemen3/index.template.php with your next post I'll have a look at it tomorrow. (it's over midnight here now)
here it is. i also attach a screenshot of how the english forum (the one that still works probably since it's a lot smaller) which uses exactly the same template bar some text.
thank you.
Can you also attach the file /sources/subs.php ?
It seems the problem is in your menubar.
here you go. thank you!
There is something strange.
Normaly the whole menubar is declared in subs.php. In your case only the default SMF menu items are in there.
I'm wondering how you got the added menu-items as "Reviews", "Software" and "Photos" in your menubar and where they are placed. Is this done by a MOD ?
I can tell you for sure the error is generated during handling the array with menu items, so it is quit logic the errors are generated every page view.
Because the searchbutton was removed from your Subs.php, the current action search2 when returning searchresults isn't valid anymore.
In /Sources/Subs.php find this
elseif ($context['current_action'] == 'search2')
$current_action = 'search';
replace with
/* elseif ($context['current_action'] == 'search2')
$current_action = 'search'; */
I modified your Subs.php, attached here ;)
@capady,
thank you for your help. the added menu items are just added in the index.template left to the default menus, as you can see here:
<table class="catbg02" style="height:30px; margin-top:2px"><tr>
<td width=486 class="catbg022">
<img src="http://www.clubsonyericsson.com/forimages/arrowita.gif" align=absmiddle> <A HREF="http://www.clubsonyericsson.com/en/category/reviews/"> Reviews </A>
<A HREF="http://www.clubsonyericsson.com/en/category/rumours/"> Rumours/Spy Photos </A>
<A HREF="http://www.clubsonyericsson.com/en/category/software/"> Software </A>
<A HREF="http://www.clubsonyericsson.com/en/category/videos/"> Videos </A>
</td>
<td width=475 class="catbg022" nowrap>';
template_menu();
echo '</td></tr></table>
the smf buttons (admin, moderate, calendar, etc) are generated in subs.php in the line 3713, but i don't remember manually editing that area. do you see something wrong?
@xenovanis. thank you for spotting that. not sure it is the cause of the errors but i'm sure it will help :)
ok so i just manually dropped the errors table so that the duplicate error ceased and my big forum started working again, and i've freed all ip's from the firewall, so you can visit them now if you need:
www.clubsonyericsson.com/foro
www.clubsonyericsson.com/forum
i applied xenovanis's suggestion but the errors are still happening.
Quote from: luiscamino on September 08, 2010, 07:50:42 AM
ok so i just manually dropped the errors table so that the duplicate error ceased and my big forum started working again, and i've freed all ip's from the firewall, so you can visit them now if you need:
www.clubsonyericsson.com/foro
www.clubsonyericsson.com/forum
i applied xenovanis's suggestion but the errors are still happening.
NICE NEWS! :)
Do you have cache enabled? If so, try clearing it in Admin -> Maintenance -> Forum Maintenance.
If that doesn't work, switch to the default theme temporarily and see if the errors continue.
no i don't have cache enabled.
the errors eveidently don't occur with the default theme since, as capady has noted, this is an issue related to my theme
i tried something. completely substituting the menu part of subs.php with the original code from an untouched subs.php file.
specifically, everything from
Quote// All the buttons we can possible want and then some...
to
Quote// Now we put the buttons in the context so the theme can use them.
but the same errors are taking place, so this can't be the area with problems, right? any other ideas of where to look?
Most likely it's in your index.template.php, but I'm not sure where to look exactly. Any change you can contact the theme author about this?
well, i'm the theme autor :) one idea would be the classic alternative removal of big random chunks of code to see if the error stops appearing at some point... but that's no guarantee that i'll find it :/
I'd suggest starting with disecting this :P
echo '
<span id="button_', $act, '"', !empty($classes) ? ' class="' . $classes . '"' : '', '>
<a title="', $act, '" href="', $button['href'], '">
', ($button['active_button'] ? '' : ''), $button['title'], ($button['active_button'] ? '' : ''), '</a></span>';
}
It's the only entry where both ['href'] and ['title'] are used. Did you use this from another theme?
thanks for spotting that!
i think i did, a couple of years ago. the template is a carry-over from some standard theme from a pre 2.0 installation, i think, meaning that there could be some things that are handled differently in 2.0 rc1 (my version).
do you think i could transplant that part of of the template_menu function from the current release into my template?
ok, so compared to the code from my theme that @xenovanis showed up there, the default theme of my 2.0 rc1 installation shows this instead:
echo '
<li id="button_', $act, '"', !empty($classes) ? ' class="' . $classes . '"' : '', '>
<a title="', $act, '" href="', $button['href'], '">
<span>', ($button['active_button'] ? '<em>' : ''), $button['title'], ($button['active_button'] ? '</em>' : ''), '</span>
</a>
</li>';
}
it seems that i changed those < LI > to some < SPAN > and removed and some other tags, but it looks like something that would still work. can you spot the bug?
well, i tried replacing that chunk of the code with what i just posted (from the default theme which, if selected, doesn't show the errors) and the errors are still happening. must be somewhere else?
ok i removed that whole template_menu function and the errors dissapeared, so the problem is in there somewhere!
i've pinpointed the source of the errors and indeed it's those "title" and "href" variables of the top menu:
echo '
<span id="button_', $act, '"', !empty($classes) ? ' class="' . $classes . '"' : '', '>
<a href="', $button['href'], '">
', $button['title'], '
</a>
</span>';
}
if i change them to any other word (say "test" and "test2") the error log shows "undefined index test" and "undefined index test2" and of course the top menu dissapears.
but nothing's wrong with that particlar code! the top menu works perfectly as it is. i have no idea why would it display an error for something that works and whose code looks ok. :/
"HRef" and "Title" are name of predifined record fields. If you change these names the record fields can't be found any longer because there are no record fields defined with the name you are using.
So, you'll get an "Undefined"-error.
exactly, but the weird thing is that i get the undefined error EVEN if i leave it as "href" and "title".
It have not to be the name of the field, the problem can also be with the content of te fields.
This noon I've copied your files in a test environment and I had the same error messages with those files so I am prety sure the problem is in one of them.
Disabling parts of the files didn't me help me till now to find why this happens.
Strange thing is, your first few menu options aren't shown in my testforum, this can be caused by the used theme. But, there is also a menu option without any text or any reasonable link. This menu option is located at the right of the logout option.
As soon as I have some time left I'll try to look furher for it.