Vasile Rogoz Posted April 9, 2023 Posted April 9, 2023 (edited) REPLACE INTO `core_follow_count_cache` ( `id`, `class`, `count`, `added` ) VALUES ( NULL, 'IPS\core\Member', 0, 1681073816 ) Column 'id' cannot be null #0 /home/directory/public_html/forum/system/Db/Db.php(972): IPS\_Db->preparedQuery('/*directory_fo...', Array) #1 /home/directory/public_html/forum/system/Patterns/ActiveRecord.php(733): IPS\_Db->replace('core_follow_cou...', Array) #2 /home/directory/public_html/forum/system/Patterns/ActiveRecord.php(761): IPS\Patterns\_ActiveRecord::_followers('member', NULL, 3, Array, NULL, NULL, NULL, true) #3 /home/directory/public_html/forum/system/Member/Member.php(1541): IPS\Patterns\_ActiveRecord::_followersCount('member', NULL, 3, Array, NULL) #4 /home/directory/public_html/forum/system/Theme/Theme.php(885) : eval()'d code(99): IPS\_Member->followersCount() #5 /home/directory/public_html/forum/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_profile->allFollowers(Object(IPS\Member), Object(IPS\Db\Select), 24) #6 /home/directory/public_html/forum/applications/core/modules/front/members/profile.php(1878): IPS\Theme\_SandboxedTemplate->__call('allFollowers', Array) #7 /home/directory/public_html/forum/system/Dispatcher/Controller.php(107): IPS\core\modules\front\members\_profile->followers() #8 /home/directory/public_html/forum/applications/core/modules/front/members/profile.php(81): IPS\Dispatcher\_Controller->execute() #9 /home/directory/public_html/forum/system/Dispatcher/Dispatcher.php(153): IPS\core\modules\front\members\_profile->execute() #10 /home/directory/public_html/forum/index.php(13): IPS\_Dispatcher->run() #11 {main} Hello community! I want an exhortation on how I could solve this, or even a precise resolution. Edited April 9, 2023 by Vasile Rogoz
Marc Posted April 11, 2023 Posted April 11, 2023 In the first instance, please update your site to the latest release of the platform and test again. If you are still seeing the same issue, please test with all 3rd party items disabled
Gabriel Torres Posted July 8, 2023 Posted July 8, 2023 @Vasile Rogoz @Marc Stridgen Today I saw this very same error in our system log. The OP failed to provide more detailed info. This error shows up when trying to see the full list of followers from a user. E.g.: https://invisioncommunity.com/profile/536186-marc-stridgen/followers Here, this error was being thrown when trying to see the follower list of a specific user. All other users the follower list displayed just fine, without throwing an error. So I knew it had to be an issue with that single user. Upon further investigation, I discovered that there was one row in the core_follow table that was pointing to a user that no longer existed. Deleting that specific row solved the issue. In fact, I found a total of 10 rows (out of 460,000) with the same issue. Deleted them all with: DELETE FROM core_follow WHERE follow_member_id NOT IN (SELECT member_id FROM core_members); Now, why this inconsistency happened? I have no clue. Maybe this is a bug caused by a third-party app, maybe it is a core bug, caused by a routine that should have deleted the corresponding rows at core_follow when the user was deleted (maybe when users request their account to be deleted?). I have no further info for you at this time, but you ought to test this further. I hope I have helped. Cheers!
Marc Posted July 10, 2023 Posted July 10, 2023 If one of you can provide an example, I can certainly then take a look
Gabriel Torres Posted July 10, 2023 Posted July 10, 2023 @Marc Stridgen As I mentioned, I deleted the offending records. My best bet is that a routine in charge of deleting users is not deleting the corresponding records in the core_follow table. I would suggest testing this by getting a test user, making it follow another user, then make the test user request his account to be deleted, approve this deletion and checking if the record in core_follow table was deleted as it should.
Daniel F Posted July 10, 2023 Posted July 10, 2023 27 minutes ago, Gabriel Torres said: would suggest testing this by getting a test user, making it follow another user, then make the test user request his account to be deleted, approve this deletion and checking if the record in core_follow table was deleted as it should. I can't reproduce this. We have in fact 2 deletion queries when a member is deleted. THe first one deletes all followed content and the second deletes the rows where other members follow the deleted member. This part from your error stack is very weird #3 /home/directory/public_html/forum/system/Member/Member.php(1541): IPS\Patterns\_ActiveRecord::_followersCount('member', NULL, 3, Array, NULL) It indicates, that the viewed profile doesn't belong to a valid member, because the second parameter should be an integerer ( the member id ) but it's NULL in your case. Is this also happening with your default thme? SeNioR- 1
Gabriel Torres Posted July 10, 2023 Posted July 10, 2023 7 hours ago, Daniel F said: Is this also happening with your default thme? As I explained in my post, this is not a theme issue. The error is thrown when one of the followers simply don't exist. The member_id is there in the core_follow table, but the member with that ID doesn't exist at the core_members table. Deleting this rogue records solved the issue for me.
Gabriel Torres Posted July 11, 2023 Posted July 11, 2023 @Marc Stridgen @Daniel F Nevermind, I found the culprit... In the past I manually deleted some members using a MySQL query, and I haven't deleted the corresponding records in the core_follow table. Therefore, the issue is entirely my fault. I no longer will delete users using queries, as this breaks things up... Thanks! Daniel F 1
Daniel F Posted July 11, 2023 Posted July 11, 2023 You'll probably have then more orphaned data than you think:D This are now all the core tables which could contain member_ids from deleted members core_clubs_memberships core_error_logs core_follow core_ignored_users core_ignored_users core_item_markers core_member_history core_members_warn_logs core_notification_preferences core_notifications core_oauth_server_access_tokens core_pfields_content core_profile_completion core_ratings core_reputation_index core_reputation_index core_security_answers core_sessions core_sys_cp_sessions core_sys_social_groups core_sys_social_group_members core_validating core_member_status_updates core_member_status_updates core_member_status_replies core_login_links core_saved_charts core_members_known_devices core_members_known_ip_addresses core_acp_notifcations_dismissals core_acp_notifications_preferences core_streams core_referrals core_referrals core_anonymous_posts core_marketplace_tokens core_member_badges core_notifications_pwa_keys core_achievements_log_milestones core_members_logins core_stream_subscriptions core_alerts_seen core_member_privacy_actions + Search Index
Gabriel Torres Posted July 11, 2023 Posted July 11, 2023 @Daniel F Jeez! Thanks! I will take a closer look and fix the boo-boo I've done to our database.
Recommended Posts