Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: santizapata on August 14, 2013, 10:31:35 PM

Title: Topic not showing up, exists in database
Post by: santizapata on August 14, 2013, 10:31:35 PM
Hello there!!

There was a server crash last week, and today I found out some topics are not showing up in the forums, even though they exist in database.

I've run all maintenance tasks (which showed up some errors), and also repaired a log table in the database, mysqlcheck shows everything is ok.

THe weird thing is that the routine error check keeps showing "has the wrong number of replies" messages, a while after I repair them.

This is one of the topics that is not showing up, what other table should I look in, to rule out/ fix database corruption as the cause?

mysql> select * from smf_topics where smf_topics.id_topic = 396;
+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+
| id_topic | is_sticky | id_board | id_first_msg | id_last_msg | id_member_started | id_member_updated | id_poll | num_replies | num_views | locked | unapproved_posts | approved | id_previous_board | id_previous_topic |
+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+
|      396 |         0 |        7 |         3102 |        3217 |                51 |                51 |       0 |          11 |      3390 |      0 |                0 |        1 |                 0 |                 0 |
+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+


Thank you!!!
Title: Re: Topic not showing up, exists in database
Post by: Arantor on August 14, 2013, 10:33:22 PM
So in the messages table, I presume there are messages with ids of 3102 and 3217?

And those messages, at least, have an id_topic of 396?
Title: Re: Topic not showing up, exists in database
Post by: santizapata on August 14, 2013, 10:38:28 PM
Thanks for the quick reply.

First off, I posted the wrong topic, it's this one (although it's pretty similar:)

+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+
| id_topic | is_sticky | id_board | id_first_msg | id_last_msg | id_member_started | id_member_updated | id_poll | num_replies | num_views | locked | unapproved_posts | approved | id_previous_board | id_previous_topic |
+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+
|      395 |         1 |        8 |         3094 |       30151 |               166 |               509 |       0 |         211 |     49227 |      0 |                0 |        1 |                 0 |                 0 |
+----------+-----------+----------+--------------+-------------+-------------------+-------------------+---------+-------------+-----------+--------+------------------+----------+-------------------+-------------------+


However, I found out that message 30151 doesn't exist indeed, I guess an inner join could cause it not to be shown? how could this happen? is there a way to fix it so that it corrects the id_last_msg for all topics based on its messages?

Thanks heaps
Title: Re: Topic not showing up, exists in database
Post by: Arantor on August 14, 2013, 10:53:42 PM
Technically the maintenance should do that for you anyway... what maintenance exactly did you run?
Title: Re: Topic not showing up, exists in database
Post by: santizapata on August 14, 2013, 11:17:47 PM
I'm using index.php?action=admin;area=repairboards i.e. the option under routine maintenance "Find and repair any errors  / If, for example, posts or topics are missing after a server crash, this function may help finding them again."