Error from the logs help needed...

Started by Yikesfactor, October 04, 2018, 11:09:40 AM

Previous topic - Next topic

Yikesfactor

I'm getting 30,000+ errors messages a day all saying this...

File: /Themes/default/BoardIndex.template.php (body_above sub template - eval?)
Line: 202

Any idea what this is and how to fix it?

I'm assuming it's a rogue mod again.  :(
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

vbgamer45

Does it say the error itself?

Also disable evaluation of templates under server settings
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Yikesfactor

The error type is undefined. Ticked the recommended box. Purged the log.

Now seeing this:

File: Themes/default/index.template.php
Line: 202

Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Yikesfactor

Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

Yikesfactor

Both definitely been modded.  :(

I'm beginning to despair about any mods fully working with 2.0.15. I keep uninstalling them to fix things.

Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

SychO

This was not done by a mod, it was done by you according to this: https://www.simplemachines.org/community/index.php?topic=562299.msg3989502#msg3989502

this is line 202 <li><a href="', $scripturl, '?action=unreadreplies">', $txt[''], '</a></li>';
the way you tried to remove the link is wrong, you have to remove the whole thing(list element) not just the array item name.

Use the file I attached instead
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Yikesfactor

Quote from: SychO on October 04, 2018, 11:59:41 AM
This was not done by a mod, it was done by you according to this: https://www.simplemachines.org/community/index.php?topic=562299.msg3989502#msg3989502

this is line 202 <li><a href="', $scripturl, '?action=unreadreplies">', $txt[''], '</a></li>';
the way you tried to remove the link is wrong, you have to remove the whole thing(list element) not just the array item name.

Use the file I attached instead

Oh.  :-[

I had a thread going about that, and no-one would tell me how to code it. In the end, someone found it and we did a quick chop. Solved one problem, created another.

It was done in both files.
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

Yikesfactor

Quote from: SychO on October 04, 2018, 11:59:41 AM
Use the file I attached instead

Can you do the other one as well please?
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

SychO

There's nothing to do in Boardindex.template.php, the error was coming from line 202 of index.template.php
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Yikesfactor

Quote from: SychO on October 04, 2018, 12:15:52 PM
There's nothing to do in Boardindex.template.php, the error was coming from line 202 of index.template.php

Go back to the first post, that was the file generating the error.

I made the same change in 2 files. So both need fixing.

Now its doing this:

File: Themes/default/Display.template.php
Line: 440
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

SychO

Quote from: Yikesfactor on October 04, 2018, 12:17:57 PM
Go back to the first post, that was the file generating the error.

I made the same change in 2 files. So both need fixing.

That's because you had theme eval turned on, by turning it off the actual file generating the error showed up

QuoteNow its doing this:

File: Themes/default/Display.template.php
Line: 440

when posting error logs, post the full error details please, I'm guessing here that's it's an undefined variable since the line contains non vanilla code, probably caused by a failed un-installation of whatever mod added that, so removing it might solve the error.
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Yikesfactor

Thanks.

But boardindex.template will need the same change as index, since the same change was made to it.

What did you do to index by the way?

What I did was to solve the crash caused by the unread replies link not working, by taking it off the screen so no-one could press it. Solve that problem and the rest of the errors vanish. No-one could though.
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

SychO

Clear your error log, do you get any errors from Boardindex.template.php ?
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Arantor

Quote from: Yikesfactor on October 04, 2018, 12:46:40 PM
No-one could though.

I wouldn't assume that no-one could, merely that no-one had yet. Try this.

Sources/Subs-Db-mysql.php

Code (find) Select

if (!empty($db_options['persist']))
$connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
else
$connection = @mysqli_connect($db_server, $db_user, $db_passwd);

// Something's wrong, show an error if its fatal (which we assume it is)
if (!$connection)
{
if (!empty($db_options['non_fatal']))
return null;
else
db_fatal_error();
}


Code (replace) Select

if (!empty($db_options['persist']))
$connection = @mysqli_connect('p:' . $db_server, $db_user, $db_passwd);
else
$connection = @mysqli_connect($db_server, $db_user, $db_passwd);

// Something's wrong, show an error if its fatal (which we assume it is)
if (!$connection)
{
if (!empty($db_options['non_fatal']))
return null;
else
db_fatal_error();
}

@mysqli_query('SET SESSION sql_mode = \'\'');

Yikesfactor

There is something fundamentally wrong with that code.

If not empty, display, else fatal error? What kind of BS coding is this?

Should be if not empty, display, else ignore.

Why would not having anything to display be a fatal error? Happens all the time! Having nothing to display is more often the case than not.

Maybe a better option is removing the whole else part?

I dont know what the bit you added does, but it doesn't seem to change the fundamental error in the code before it.
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

Kindred

no. the code as written is correct and is not "bs coding"


if it can not connect to the database and there's not a non-fatal error logged, assume the error is fatal and display.

This is correct and logical.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Yikesfactor

Quote from: Kindred on October 05, 2018, 01:44:34 AM
no. the code as written is correct and is not "bs coding"


if it can not connect to the database and there's not a non-fatal error logged, assume the error is fatal and display.

This is correct and logical.

But that's not what is happening.

If there are no unread replies to display, it crashes.

Nothing at all to do with not connecting to the database.

So maybe that isn't the correct bit of code with the problem. Somewhere there, a chunk of code says I cant find anything to display, and this is a fatal error, crash. Which is wrong. Perhaps it's as simple as the wrong error indicator is set when there is nothing to return.

Logic is a 2 edged sword. If its built on the wrong assumption, it becomes BS. So if the assumption is when there is nothing to display this is a real problem, the logic to display the problem is BS. Because nothing to display is not a problem, but something to be expected and handled by displaying nothing.
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

Arantor

No, you don't get it. This is from the very very core of SMF. Like the first thing it does when it connects to the database before anything else. If it can't make that connection, you're already done and nothing else can possibly work because there's no connection to the database to work out who the user is, or to get topics or anything. This is LONG BEFORE the error you get.

In that situation there is nothing you can do but abort with an error message.

The part you fail to understand is that I was telling you to add a single line immediately after that to turn off strict mode, just after a successful connection is made, turn off strict mode for the rest of the current page. Being in strict mode is why you get that error way later on, so turn it off at the first opportunity.

But sure, tell one of the former dev team (me) that he's talking BS. It might be why you didn't get help before.

Yikesfactor

No need to get so prickly.

You appear to be talking about a database not being there problem, for which there is no error message to suggest anything of the kind.

I'm talking about a no replies to display problem.

Not the same thing, and I dont know why a database issue even came up. If there was a database issue, there would be a database error message. No?

Quote from: Arantor on October 05, 2018, 02:47:21 AM
The part you fail to understand is that I was telling you to add a single line immediately after that to turn off strict mode, just after a successful connection is made, turn off strict mode for the rest of the current page. Being in strict mode is why you get that error way later on, so turn it off at the first opportunity.

So why not say that?

Post a bit of incomprehensible code and say put this in, isn't going to get you the same response as this does this which should alleviate your problem if you put it there.

People respond better to explanation, than cryptic code.

Anyway, subject is now moot. I found the mod which does 4 of these, put the original file back in, installed the mod, and problem solved.
Version 2.0.15

Used phpBB before, new to SMF.

I know enough to be dangerous.
Breaking things is my specialty.

Arantor

#20
No need to get so prickly? Don't start by misunderstanding something and declaring it BS then!

Your unreadreplies problem is a MySQL strict mode problem. Solution: turn off strict mode ASAP, since your host wouldn't turn it off for you.

Best place to do that? As soon as SMF has connected to MySQL, which is exactly what I proposed.

Instead of trying to do it in just the places it might be a problem, I suggested turning it off to fix all the problems you might encounter in this regard, but sure, just because you don't understand that a thing over here can affect a thing over there you declare it BS.

That's why I'm prickly, because I actually understand how SMF works having been building code on it for a decade, and yet you declare it BS. Why didn't I explain it? Because I wanted to get you the solution but I was too tired last night to explain it to you, though clearly suggesting a global fix for all these type of problems is a waste of time.

Sorry for trying to help, it won't happen again.

SychO

Yikesfactor someone tries to help you and this is how you respond to them

unbelievably rude
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

GigaWatt

Quote from: Yikesfactor on October 05, 2018, 03:05:47 AM
Post a bit of incomprehensible code and say put this in, isn't going to get you the same response as this does this which should alleviate your problem if you put it there.

And being polite also goes a long way. Telling someone who was on the dev team they wrote BS code is like someone saying to you "your forum is BS"... you wouldn't take that lightly, would you?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Advertisement: