Interesting anomaly here…I searched but found no similar reports.
Last night the forums were working great. No WP or SP updates were performed since then. This morning, all forum pages fail to load, only displaying white page of death with the error:
Call to undefined function sp_linking_do_header()
No related errors or in SP Error Log.
No error displayed with Blog Post Linking AND Auto Linking plugins deactivated.
No Error with Auto Linking plugin activated.
With Blog Post Linking active, error is thrown.
Reset SP Script Cache…activate BPL = error.
Update BPL Options… error.
Flush General Cache… error.
Clean Up Transients… error.
Re-check SP Error Log:
14 August 2019 10:02 am | spaErrError | 10 | databasefile: /home/user/public_html/wp-content/sp-resources/forum-plugins/blog-linking/sp-linking-plugin.php
error: Duplicate key name ‘post_idx’
ALTER TABLE wp_x_sflinks ADD KEY post_idx (post_id), ADD KEY forum_idx (forum_id), ADD KEY topic_idx (topic_id);
Check Table via PHP MyAdmin:
wp_x_sflinks check status OK
wp_x_sflinks analyze status OK
wp_x_sflinks optimize note Table does not support optimize, doing recreate + …
wp_x_sflinks optimize status OK
Reactivate Blog Post Linkng… error persists.
BPL Plugin is currently deactivated and our Tripawds forums are functioning as expected with no errors.
What further steps can I take to identify the cause of this issue and get it resolved?
Thanks in advance for the help!
Can you post the full error from the wordpress debug.log file for “Call to undefined function sp_linking_do_header()”? Usually it includes a nested series of paths with that kind of error that shows the various interim function calls before the error is thrown.
Simple Press said
post the full error from the wordpress debug.log file for…
Yuck, whole bunch o’ stuff in the error logs related to the x error. Some may be related to my troubleshooting, but nothing specifically mentioning sp_linking_do_header().
Will send text file via PM.
Thanks for the quick response!
Looks like the PM didn’t contain the text file. But maybe one thing to try would be to delete the blog linking plugin complete and then upload and reinstall it. Maybe a file it needs got deleted or corrupted somehow.
Simple Press said
Looks like the PM didn’t contain the text file…
Resent it, however…
FYI: After restarting Apache and PHP-FPM, the forums are now loading again without the error page displayed. BUT: I am still seeing this error in the server logs:
[14-Aug-2019 18:10:21 UTC] WordPress database error Duplicate key name ‘post_idx’ for query ALTER TABLE wp_1_sflinks ADD KEY post_idx (post_
id), ADD KEY forum_idx (forum_id), ADD KEY topic_idx (topic_id); made by include(‘/plugins/simplepress/admin/panel-plugins/spa-plugins.php’)
, spa_save_plugin_activation, spcPlugin->activate, do_action(‘sph_activate_blog-linking/sp-linking-plugin.php’), WP_Hook->do_action, WP_Hook
->apply_filters, sp_linking_install, sp_linking_do_install, spcDB->execute
[14-Aug-2019 18:10:21 UTC] WordPress database error Duplicate key name ‘blog_post_idx’ for query ALTER TABLE wp_1_sftopics ADD KEY blog_post
_idx (blog_post_id); made by include(‘/plugins/simplepress/admin/panel-plugins/spa-plugins.php’), spa_save_plugin_activation, spcPlugin->act
ivate, do_action(‘sph_activate_blog-linking/sp-linking-plugin.php’), WP_Hook->do_action, WP_Hook->apply_filters, sp_linking_install, sp_link
It looks like perhaps its attempting to perform some sort of upgrade to the database for the blog linking tables that might have been performed before. So, perhaps the best thing to do is to delete the two indexes on the SFLINKS table that its complaining about and just let it recreate it.
That should allow the upgrade routine to complete properly on that table which would set the flag that tells it never to run again. Its weird because that upgrade routine was supposed to be run all the way back when 5.0.0 was released.
Simple Press said
…the best thing to do is to delete the two indexes on the SFLINKS table that its complaining about and just let it recreate it.
Interestingly, I’m no longer seeing this error in the SF error log, or server error logs after clearing the logs and reloading various forum pages.
If it reoccurs, could you please confirm the following:
To delete these indexes, can it be done via the Rebuild Indexes option in the SF Housekeeping Toolbox?
Or, do I Drop these indexes using PHP MyAdmin?
KEY post_idx (post_id)
KEY forum_idx (forum_id)
KEY topic_idx (topic_id)
There is no index for blog_post_idx in sflinks table, so should I also Drop this index:
KEY blog_post_idx (blog_post_id)
Before i break anything, please also confirm that these indexes will rebuild automatically if I do drop them.
Using the REBUILD indexes will not run the installation routine that sets the flag.
But, since the problem is no longer occurring, it could be something else that’s triggering it – it sounds as if the issue is intermittent – and that kind of negates my original theory. So, there’s no guarantee that once the indexes are dropped that the installation routine will run. But its still worth a shot. But, definitely back up the database before dropping the indexes – this way if they’re not re-created you can restore the db.
The indexes that should be dropped would be:
And on the SPTOPICS table,