Jump to content

Database errors


Recommended Posts

I've had to restore my server and now I face intermittent database issues. One is preventing access to a subforum:

The log entry was triggered by a guest (Guests)

REPLACE INTO `ibf_core_item_member_map` (map_member_id, map_item_id, map_latest_date, map_class) SELECT DISTINCT `author_id`, `topic_id`, UNIX_TIMESTAMP(), 'IPS\\forums\\Topic' FROM `ibf_forums_posts` AS `forums_posts` WHERE ( queued IN(0,2) ) AND ( topic_id IN(214816) )
IPS\Db\Exception: Can't find record in 'ibf_core_item_member_map' (1032)
#0 /home/nginx/domains/zzzzz/public/community/system/Db/Db.php(969): IPS\_Db->preparedQuery()
#1 /home/nginx/domains/zzzzz/public/community/system/Node/Statistics.php(295): IPS\_Db->replace()
#2 /home/nginx/domains/zzzzz/public/community/system/Node/Statistics.php(76): IPS\forums\_Forum->rebuildPostedIn()
#3 /home/nginx/domains/zzzzz/public/community/system/Node/Statistics.php(160): IPS\forums\_Forum->authorsPostedIn()
#4 /home/nginx/domains/zzzzz/public/community/system/Helpers/Table/Content.php(499): IPS\forums\_Forum->contentPostedIn()
#5 /home/nginx/domains/zzzzz/public/community/system/Helpers/Table/Table.php(489): IPS\Helpers\Table\_Content->getRows()
#6 /home/nginx/domains/zzzzz/public/community/applications/forums/modules/front/forums/forums.php(537): IPS\Helpers\Table\_Table->__toString()
#7 /home/nginx/domains/zzzzz/public/community/applications/forums/modules/front/forums/forums.php(38): IPS\forums\modules\front\forums\_forums->_forum()
#8 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Controller.php(101): IPS\forums\modules\front\forums\_forums->manage()
#9 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Dispatcher.php(153): IPS\Dispatcher\_Controller->execute()
#10 /home/nginx/domains/zzzzz/public/community/index.php(13): IPS\_Dispatcher->run()
#11 {main}

Backtrace:

#0 /home/nginx/domains/zzzzz/public/community/system/Db/Db.php(969): IPS\_Db->preparedQuery()
#1 /home/nginx/domains/zzzzz/public/community/system/Patterns/ActiveRecord.php(733): IPS\_Db->replace()
#2 /home/nginx/domains/zzzzz/public/community/system/Patterns/ActiveRecord.php(761): IPS\Patterns\_ActiveRecord::_followers()
#3 /home/nginx/domains/zzzzz/public/community/system/Member/Member.php(1516): IPS\Patterns\_ActiveRecord::_followersCount()
#4 /home/nginx/domains/zzzzz/public/community/uploads/template_9_af46883c13caa197f9e387620d19e6ec_profile.php(3529): IPS\_Member->followersCount()
#5 /home/nginx/domains/zzzzz/public/community/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_profile->profileHeader()
#6 /home/nginx/domains/zzzzz/public/community/uploads/template_9_af46883c13caa197f9e387620d19e6ec_profile.php(4910): IPS\Theme\_SandboxedTemplate->__call()
#7 /home/nginx/domains/zzzzz/public/community/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_profile->userContent()
#8 /home/nginx/domains/zzzzz/public/community/applications/core/modules/front/members/profile.php(623): IPS\Theme\_SandboxedTemplate->__call()
#9 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Controller.php(90): IPS\core\modules\front\members\_profile->content()
#10 /home/nginx/domains/zzzzz/public/community/applications/core/modules/front/members/profile.php(73): IPS\Dispatcher\_Controller->execute()
#11 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Dispatcher.php(153): IPS\core\modules\front\members\_profile->execute()
#12 /home/nginx/domains/zzzzz/public/community/index.php(13): IPS\_Dispatcher->run()
#13 {main}

LOADED HOOKS

The other:

The log entry was triggered by a guest (Guests)

REPLACE INTO `ibf_core_follow_count_cache` ( `id`, `class`, `count`, `added` ) VALUES ( 156355, 'IPS\forums\Topic', 0, 1657065094 )
IPS\Db\Exception: Duplicate entry '156355-IPS\forums\Topic' for key 'id_class' (1062)
#0 /home/nginx/domains/zzzzz/public/community/system/Db/Db.php(969): IPS\_Db->preparedQuery()
#1 /home/nginx/domains/zzzzz/public/community/system/Patterns/ActiveRecord.php(733): IPS\_Db->replace()
#2 /home/nginx/domains/zzzzz/public/community/system/Content/Item.php(7996): IPS\Patterns\_ActiveRecord::_followers()
#3 /home/nginx/domains/zzzzz/public/community/system/Content/Item.php(8010): IPS\Content\_Item->followers()
#4 /home/nginx/domains/zzzzz/public/community/applications/forums/modules/front/forums/topic.php(555): IPS\Content\_Item->followersCount()
#5 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Controller.php(101): IPS\forums\modules\front\forums\_topic->manage()
#6 /home/nginx/domains/zzzzz/public/community/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
#7 /home/nginx/domains/zzzzz/public/community/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
#8 /home/nginx/domains/zzzzz/public/community/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\front\forums\_topic->execute()
#9 /home/nginx/domains/zzzzz/public/community/index.php(13): IPS\_Dispatcher->run()
#10 {main}

Backtrace:

#0 /home/nginx/domains/zzzzz/public/community/init.php(1015): IPS\_Log::log()
#1 [internal function]: IPS\IPS::exceptionHandler()
#2 {main}

LOADED HOOKS

 

Any ideas? 

Link to comment
Share on other sites

13 minutes ago, Randy Calvert said:

IPS\Db\Exception: Duplicate entry '156355-IPS\forums\Topic' for key 'id_class' (1062)

This seems to show there is a problem with your database when you restored it.  

Yes. I have some corruption issues. I'm looking to see if I can fix the corruption.

Link to comment
Share on other sites

Ok, I got rid of all the errors by either issuing ALTER TABLE zzz ENIGINE = InnoDB or by replacing those tables with a copy from a few days ago. CHECK TABLE shows no more corruption and site loads fine. Will have issues if I loaded these slightly older tables:

core_item_member_map
core_members_logins


??? What type of data do they hold?

Link to comment
Share on other sites

3 hours ago, Marc Stridgen said:

These hold data relating to logins and data mapping what items a user has posted in. We cannot really recommend mixing and matching data from different points in time

Not recommending is a pretty low bar.

Can you give me an example of the consequences? What would happen if these specific tables were off by a couple days? I'm just looking for something tangible here.

Edited by Zone Plate
Link to comment
Share on other sites

Im not sure where the bar is low there. We cannot recommend outdated data is mixed with new data, and as we have not tested as much, we cannot advise for certain on the consequences of doing so. Of course login logs would not be correct as thats what one of the tables stores, and the system would not know some users have posted in some topics. 

Link to comment
Share on other sites

3 minutes ago, Marc Stridgen said:

Im not sure where the bar is low there. We cannot recommend outdated data is mixed with new data, and as we have not tested as much, we cannot advise for certain on the consequences of doing so. Of course login logs would not be correct as thats what one of the tables stores, and the system would not know some users have posted in some topics. 

So, if I can extract something out of this:

core_members_logins: just maintains a running list of when people log in. Latest login shows up in profile and Admin shows a list.
Me: That seems like missing data there has a really low impact. Sounds just informational and does not have critical data for functionality.

core_item_member_map: Records who posts in a topic. Anything else?
Me: another informational table. Sounds just informational and does not have critical data for functionality, but less clear on when this is used.

Link to comment
Share on other sites

It will likely cause you issues with referencing internally. How much of an issue this will cause is unknown without specifically looking at your old and new data, which is not something we would be able to do under support. Our advice is always if you are restoring a database, its all or nothing. You really shouldnt be piecing a database together in the manner you are trying to there.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...