Weird error 500

Started by Gryzor, February 19, 2024, 06:11:30 AM

Previous topic - Next topic

@rjen

Did you get closer to an explanation for this?

Background: I ran into the same issue today on a test forum.

Some specifics; version 2.1.4, the board index fails to load with this memory issue.

But here is the weird part: only for admin users, and only in two themes.
Works fine for regular users in all themes, also works fine for admin in curve2.

Now I tested this as admin yesterday in the test board and it worked fine (on a database backup of about a year hold) today I refreshed the database with todays fresh backup of the main forum.

Problem occurred after that: files unchanged from yesterday, which suggests it is somehow related to what's in the database...

Themes that give the errors: NameX and Blindspot
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Gryzor

Sadly, no. Everything seems to be running fine with the new php memory limit, but no clue as to what caused the issue. 

shawnb61

Quote from: @rjen on February 24, 2024, 11:32:04 AMProblem occurred after that: files unchanged from yesterday, which suggests it is somehow related to what's in the database...

Themes that give the errors: NameX and Blindspot

Do you also use the Recent Topics on Home Page mod?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Gryzor

Quote from: shawnb61 on February 24, 2024, 02:39:03 PM
Quote from: @rjen on February 24, 2024, 11:32:04 AMProblem occurred after that: files unchanged from yesterday, which suggests it is somehow related to what's in the database...

Themes that give the errors: NameX and Blindspot

Do you also use the Recent Topics on Home Page mod?
Let me check tomorrow morning. I think I've uninstalled it but maybe it wasn't removed properly. 

shawnb61

Just trying to understand if the mod is common to both. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

@rjen

I don't have it,  it what puzzles me is that it is theme specific
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

shawnb61

I would set $db_show_debug to true in settings.php.

Load the board index in the two themes & compare the two results.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

@rjen

Quote from: shawnb61 on February 24, 2024, 07:20:50 PMI would set $db_show_debug to true in settings.php.

Load the board index in the two themes & compare the two results.

Triedd that, but when the pageload fails (as admin) I am not getting any logging (obviously) and when it does work (not as admin) the log is different of course, but no indication where it goes wrong...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Arantor

That implies something is running away and running a lot of queries.

Try temporarily turning the memory limit up again and turning logging on.

@rjen

Tried that no change. Just no sure if I changed the correct limit
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Arantor

So even with logging enabled it still fails as an admin? Then the limit isn't high enough.

@rjen

As always, you are right, I must have been updating the chache size limit instead of memory limit.

Memory limit was set to 96M , changed it first to 128, then 256, but the boardindex first loaded when I set it to 512M...

Now let's see if I can identify the query or queries causing it..
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Gryzor

Fwiw I haven't been able to pinpoint the moments that php mem goes high, it always seems quite stable... (I don't remember which monitoring command I used)

@rjen

So I am comparing the queries,
Curve2: 17 Queries used
NameX: 23 Queries used,

So I would expect to see a difference in those 6 queries

Comparing the logs I see this..
The 6 extra queries seem to run pretty quickly, but ...

In the boardindex there is an extra join on the attachment table (I think it is meant to collect the avatar info, which the theme uses) and that makes the query run for almost a second...

You cannot view this attachment.

I suspect this is the cause of the high memory consumption?

By the  way I was running this example with two different users, both Admins, getting similar query times when the same user, so pretty sure this is the reason...

Any tips on how this could be improved?

and yes, I know: I will also have to report this in the NameX thread...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Quote from: shawnb61 on February 24, 2024, 04:40:20 PMJust trying to understand if the mod is common to both. 

Just looked at Gryzors site and noticed that he is running a Mod showing avatars on the board index: that seems to be the common factor
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Meh, checking the code this logic is actually standard SMF, whenever a theme or mod sets the parameter avatars-on-boardindex

Is this perhaps an SMF bug that appears on forums with a certain amount of boards/users/attachments?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Arantor

You'd need to have a LOT of boards for that to be a significant problem though.

@rjen

Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Gryzor

Quote from: @rjen on February 25, 2024, 08:05:47 AM
Quote from: shawnb61 on February 24, 2024, 04:40:20 PMJust trying to understand if the mod is common to both. 

Just looked at Gryzors site and noticed that he is running a Mod showing avatars on the board index: that seems to be the common factor
Yeah, avatar integration but still:

-worked just fine, problem cropped up out of nowhere
-problem appears only when signed in...

@rjen

Just did a quick count: 95 boards and child boards. Sounds like a lot, but not that much imo
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Advertisement: