Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: aegersz on March 05, 2020, 09:35:06 PM

Title: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 05, 2020, 09:35:06 PM
I have attached a screenshot as I get 36 errors when i click on "Forum" only. (?)

Your thoughts, please ?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: drewactual on March 05, 2020, 10:16:14 PM
lets see your boardindex.template?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 05, 2020, 10:22:54 PM
sure; see attached
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 04:45:43 AM
... in the meanwhile, is there a way to disable logging of 8: Undefined index: xyz errors in SMF ?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Dzonny on March 06, 2020, 06:36:51 AM
Do you have other languages installed on forum apart form English?
Also your topic name is "since moving to 2.0.17". From what did you moved exactly?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 07:15:51 AM
No, English only.

I don't recall seeing these errors when on 2.0.15.

I only recently upgraded to 2.0.16 and immediately after to 2.0.17.

I even compared the boardindex template to a "vanilla" version and it's barely different.

I just do not understand why the error happens in the first place ... but then again, i should've tested 0.16 and 0.17 more before upgrading and now it's too late to go back.

The problem is that my DB is filling with error logs so any help, as always, is appreciated.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Dzonny on March 06, 2020, 07:53:09 AM
Okay, until someone finds solution I'd suggest trying to just add those strings in language files, so for example, open Themes/default/language/index.english.php and just add empty strings to temporary stop errors, like:
$txt['is_redirects'] = '';
$txt['topics'] = '';


I have no idea why you're getting those though, is_redirect shouldn't be a string afaik. Do you have any mods installed?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 09:30:57 AM
Thanks and yes, over 140 mods installed !

I knew that they would eventually cause me grief but so far, so lucky ... almost anyway.

I will try your suggestion a bit later (currently at a nightclub).
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 11:46:26 AM
Quote from: Dzonny on March 06, 2020, 07:53:09 AM
Okay, until someone finds solution I'd suggest trying to just add those strings in language files, so for example, open Themes/default/language/index.english.php and just add empty strings to temporary stop errors, like:
$txt['is_redirects'] = '';
$txt['topics'] = '';


I have no idea why you're getting those though, is_redirect shouldn't be a string afaik. Do you have any mods installed?

Your suggestion made no difference, sorry to say; SMF is still logging those pesky errors.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 12:35:06 PM
Hardly surprising you're still getting those errors as they're not emanating from an index in the $txt array, so I've no idea why you were given that advice  ::)

It's the $board array that needs addressing
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 01:36:50 PM
Yes, i thoughts that this error indicates an index outside of an array.

But my PHP is too rudimentary to spot the reason why I am getting errors and considering it
s all working fine, I still perplexed.

Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 01:43:17 PM
Do you have any categories without any boards defined?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 02:09:56 PM
A good thought but I do not.

Hang on, I found an empty board with no title or description ...
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 02:17:52 PM
see attached ...

no way can I remove it -- i tried adding temp/tempo but it just pushed the board down.

this may require some delicate DB surgery ?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 02:18:22 PM
So, did you fix it?
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 02:20:42 PM
no, I can't figure out how to remove it as it doesn't appear in Admin > Forum > Boards.

will keep fiddling though.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 02:37:32 PM
I can't even see a blank entry or 0 board ID in phpmyadmin; I now defer to the gurus ... and yes, I have run all the Maintenance that the forum offers.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 03:05:53 PM
Run this query

delete from smf_boards where name = '';


.. or check to see if a query can find your corrupt board

select * from smf_boards where name = '';
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 03:29:48 PM
Actually, I just visited your forum and can see (looking at the page source) that the rogue board does not have a board_id.



Try creating a new board within your "Core Topics" category and see what that does to the board indexing.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 03:31:16 PM
no luck; I would've seen a null row in phpmyadmin anyway.

mysql> delete from smf209_boards where name = '';
Query OK, 0 rows affected (0.00 sec)


mysql> select * from smf209_boards where name = '';
Empty set (0.00 sec)


I feel that it is a PHP error somewhere. I just checked on old 2.0.15 backup system of mine and it had no such blank board.

... and don't we all love a good mystery  8) O:)

I like your ideas though ... but how can this be ?

Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 03:33:00 PM
Quote from: Shambles on March 06, 2020, 03:29:48 PM
Actually, I just visited your forum and can see (looking at the page source) that the rogue board does not have a board_id.



Try creating a new board within your "Core Topics" category and see what that does to the board indexing.

I did that and called it Temp (Tempo) (see earlier screenshot). I even moved another board in and out of the category. The board does not have any id, as you correctly mentioned.

The Board handling logic must be very old and I can't imagine that the 2.0.16 (and above) are the culprits.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 03:39:54 PM
Ok let's take this one step back.

Run a query to show the category IDs in use in your smf209_boards table.

select id_cat from smf209_boards;

Make sure each and every board has a valid category number.

To see valid category numbers, select * from smf209_categories;


My thinking here is that you have a board with a non-existent category
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 03:47:13 PM
I see ... no, i have accounted for all categories and boards

mysql> select id_cat, id_board from smf209_boards order by 2;
+--------+----------+
| id_cat | id_board |
+--------+----------+
|      1 |        1 |
|      2 |        2 |
|      2 |        3 |
|      2 |        4 |
|      2 |        6 |
|      3 |        7 |
|      1 |        9 |
|      2 |       11 |
|      2 |       12 |
|      2 |       13 |
|      2 |       14 |
|      2 |       21 |
|      2 |       22 |
|      2 |       23 |
|      2 |       24 |
|      2 |       25 |
|      2 |       26 |
|      2 |       29 |
|      2 |       31 |
|      2 |       32 |
|      2 |       33 |
|      2 |       34 |
|      2 |       36 |
|      2 |       37 |
|      2 |       38 |
|      2 |       39 |
|      2 |       40 |
|      2 |       41 |
|      2 |       42 |
|      2 |       43 |
|      2 |       44 |
|      2 |       45 |
|      2 |       48 |
|      2 |       49 |
|      2 |       52 |
|      2 |       53 |
|      3 |       54 |
|      2 |       55 |
|      2 |       56 |
|      2 |       57 |
|      2 |       58 |
|      2 |       59 |
|      9 |       60 |
|      3 |       61 |
|      2 |       62 |
|      2 |       63 |
|      2 |       64 |
|      3 |       65 |
|      2 |       66 |
|      1 |       67 |
|      2 |       68 |
|      2 |       70 |
|      2 |       71 |
|      2 |       72 |
|      2 |       73 |
|      2 |       74 |
|      2 |       75 |
|      2 |       76 |
|      2 |       77 |
|      2 |       78 |
|      2 |       79 |
|      2 |       80 |
|     11 |       85 |
|      2 |       86 |
|      2 |       87 |
|     11 |       88 |
|      2 |       89 |
|      1 |       90 |
|     10 |       91 |
|     10 |       92 |
|      8 |       93 |
|      2 |       94 |
|      2 |       95 |
|      2 |       96 |
|      3 |       97 |
|      1 |       98 |
|     12 |       99 |
|     12 |      100 |
|      1 |      101 |
|      2 |      102 |
|      2 |      103 |
|     13 |      104 |
|      2 |      105 |
|      2 |      106 |
|     12 |      107 |
|      2 |      108 |
|      2 |      109 |
|     12 |      110 |
|      2 |      111 |
|      2 |      112 |
|      2 |      113 |
|      2 |      114 |
|      1 |      115 |
|      2 |      116 |
|      2 |      117 |
+--------+----------+
95 rows in set (0.00 sec)


mysql> select * from smf209_categories;
+--------+-----------+---------------+--------------+
| id_cat | cat_order | name          | can_collapse |
+--------+-----------+---------------+--------------+
|      1 |         0 | General       |            1 |
|      2 |         3 | Core Topics   |            1 |
|      3 |         1 | Technology    |            1 |
|      8 |         4 | In Memoriam   |            1 |
|      9 |         5 | Treasury      |            1 |
|     10 |         8 | Salvage Area  |            1 |
|     11 |         7 | Archives      |            1 |
|     12 |         2 | Mind and Body |            1 |
|     13 |         6 | Private       |            1 |
+--------+-----------+---------------+--------------+
9 rows in set (0.00 sec)
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 04:00:58 PM
Ok, try the following which should skip the faulty board.

I'll look into this later.

Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 04:01:20 PM


Thanks for temporarily patching the code for me, Shambles. It works.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 04:24:57 PM
Quote from: aegersz

Thanks for temporarily patching the code for me. It works.


Glad to hear it :)

The "patch" is simply to exclude board outputs that have unset board_id's, so it's more of a fudge than anything else, though the change I made is still a valid check on all board_ids.

When/if I get time (I'm at work at the moment) I'll try and figure out how this situation could occur.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 06, 2020, 04:30:44 PM
Thanks. I did actually look at your changes and saw that you only processed valid board id numbers:

diff BoardIndex.template.php BoardIndex.template.php-orig
148,149d147
<                               if(!empty($board['id']))
<                               {
255d252
<                       }


I'm marking this as solved anyway as i fear it will be too hard to followup on and your time is valuable.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Shambles on March 06, 2020, 04:36:48 PM
As before, you're welcome, but this issue is now in my Jira workset so I will look into it at some point mate ;)
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 12, 2020, 08:27:37 AM
One more thing, these 2 additional errors occur when selecting the "forum" option still:

see attached ...
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: Kindred on March 12, 2020, 09:17:34 AM
that's mod code...
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on March 12, 2020, 09:25:26 AM
Thanks Kindred ... it is actually:

* @package Avatars on Board_MessageIndex
* @version 1.9
* @Author: Pipke(AdemaStudios)
* @copyright Copyright (C) 2016, Pipke

I think i will upgrade that mod in my live system also as the errors go away in the latest mod version.
Title: Re: Very high rate of errors since moving to 2.0.17 (another issue re. "Forum" page)
Post by: aegersz on June 11, 2021, 01:52:13 AM
The fix for the above can be found here (https://www.simplemachines.org/community/index.php?topic=544924.msg4089959#msg4089959).