Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Upgraded test site and got Table '_sfforums' doesn't exist
Avatar
Chris Moody
Member
sp_UserOfflineSmall Offline
Nov 22, 2017 - 5:39 am

Hi,

 

Before I update the life site I did a test site but I can not create new forums anymore

and get this message

../public_html/wp-content/plugins/simple-press/admin/panel-forums/forms/spa-forums-global-rss-form.php
line: 40
function: spdb_count
error: Table '_sfforums' doesn't exist

SELECT COUNT(*) FROM _sfforums WHERE forum_rss_private=1

I've tried deleting everything and did a fresh install but something is not right here 🙂

Please advise

 

Regards,

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 22, 2017 - 6:09 am

Somebody else had a problem with this table recently but I have had no update on the state of the problem or if it is resolved. And it is very strange indeed. The first thing I can assure you of is that there have been no database updates since version 5.7.2 which is quite a while back so nothing in the upgrade procedure should have any bearing on this.

Let me say to you what I said to the other user...

I can think of two possibilities.

The first - and the worse - is that the table has been deleted. The only person, I would think, who would know that is you and I assume you have not done this!

But the other possibility - and perhaps the more likely - is that it has become unavailable because it needs a repair and optimisation. The WordPress team never tells you this but mySQL databases really need some care and maintenance regularly to keep them in top condition. If left, then sooner or later one of the tables will crash and will require repairing. This can be averted by regular optimisation.

I would recommend a WP plugin such as 'WP Optimize' (https://wordpress.org/plugins/.....-optimize/) which can perform an optimisation on demand but can also be scheduled to run in the background at set intervals. This particular plugin also removed cruft from the database so you need to make sure you are happy for that to happen and if not there are alternative plugins available. As far as I know this plugin will perform repairs as well.

But, as this is a test site, then you can probably look at the database (i.e., using phpMyAdmin for example) to determine if the table IS still there...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 22, 2017 - 6:10 am

By the way - can I assume that when you quoted the error you purposefully removed the table prefix?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Moody
Member
sp_UserOfflineSmall Offline
Nov 27, 2017 - 2:30 pm

Correct I did remove the prefix.

I've looked in the database but table is not in.

Do you have a script so I can create the tables ? After a repair with wp-optimize it is not working yet 😉

 

regards,

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 27, 2017 - 3:46 pm

I have added the script below although note you will need to (a) replace the 'xxx' with your table prefix and (b) change the engine if you are not using myISAM tables.

There is nothing in the upgrade script at all. All that happens during thje upgrade process is that the build and version numbers are updated in the sfoptions table. So I am afraid I have no idea what may have happened to your table.... Do you have any ideas?

Of course - the table creation can not replace any missing data. Note that I have included any new columns created by SP plugins as I am unsure what, if any, you may be using.

CREATE TABLE `xxx_sfforums` (
 `forum_id` bigint(20) NOT NULL AUTO_INCREMENT,
 `forum_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
 `group_id` bigint(20) NOT NULL,
 `forum_seq` int(4) DEFAULT NULL,
 `forum_desc` mediumtext COLLATE utf8mb4_unicode_ci,
 `forum_status` int(4) NOT NULL DEFAULT '0',
 `forum_slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
 `forum_rss` mediumtext COLLATE utf8mb4_unicode_ci,
 `forum_icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `post_id` bigint(20) DEFAULT NULL,
 `topic_count` mediumint(8) DEFAULT '0',
 `forum_rss_private` smallint(1) NOT NULL DEFAULT '0',
 `topic_status_set` bigint(20) DEFAULT '0',
 `post_count` mediumint(8) DEFAULT '0',
 `post_ratings` smallint(1) NOT NULL DEFAULT '0',
 `use_tags` smallint(1) NOT NULL DEFAULT '1',
 `parent` bigint(20) NOT NULL DEFAULT '0',
 `children` mediumtext COLLATE utf8mb4_unicode_ci,
 `forum_message` mediumtext COLLATE utf8mb4_unicode_ci,
 `in_sitemap` smallint(1) NOT NULL DEFAULT '1',
 `post_id_held` bigint(20) DEFAULT NULL,
 `post_count_held` mediumint(8) DEFAULT '0',
 `forum_icon_new` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `topic_icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `topic_icon_new` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `forum_email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `polls` smallint(1) NOT NULL DEFAULT '0',
 `keywords` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `forum_disabled` smallint(1) NOT NULL DEFAULT '0',
 `topic_icon_locked` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `forum_icon_locked` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `topic_icon_pinned` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `feature_image` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `last_topic_id` bigint(20) NOT NULL DEFAULT '0',
 `topic_icon_pinned_new` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `permalink_slug` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL,
 `forum_hide_posters` smallint(1) NOT NULL DEFAULT '0',
 PRIMARY KEY (`forum_id`),
 KEY `group_id_idx` (`group_id`),
 KEY `forum_slug_idx` (`forum_slug`),
 KEY `post_id_idx` (`post_id`),
 KEY `topic_status_set_idx` (`topic_status_set`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Moody
Member
sp_UserOfflineSmall Offline
Nov 29, 2017 - 3:23 am

That did the trick thanks !

smile

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 29, 2017 - 3:38 am

It would be nice to know what happened though....

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Moody
Member
sp_UserOfflineSmall Offline
Jan 15, 2018 - 5:31 am

Hi,

I there are more errors like _sftopics does not exsist as well

ine: 464
function: spdb_table
error: Table 'xxx_sftopics' doesn't exist

SELECT * FROM xxx_sftopics WHERE forum_id=2

Do you have a tool or script  to recreate all tables ?

And just like you said @yellow-swordfish it would be great to know why this is happening.

 

regards,

 

PS I have delete the whole plugin looked at the tables are were gone did a clean install but those tables were not created

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 15, 2018 - 6:08 am

I wish I could think of an explanation for this quite unique experience. I have to say that if I were you I would be asking my host to look at the mySQL error log to see if they can determine what the problem is. For the record - all of our tables are created using the same structure and syntax so if some are successful it is hard to determine why some should not be. If there is some sort of mySQL problem it could affect other plugins you may want to install in the future.

I can give you a script for any missing table but I think it would be wise to check which ones are actually missing in case there are others. The worry os that some of them come pre-populated with data se we should just check if any fall into that category.

So - below is a complete list of the tables defined with a new install. Perhaps you could check them all and I can then construct a definitive SQL script for you.

sfgroups
sfforums
sftopics
sfposts
sftrack
sfusergroups
sfpermissions
sfdefpermissions
sfroles
sfmembers
sfmemberships
sfmeta
sflog
sflogmeta
sfoptions
sferrorlog
sfauths
sfauthcats
sfwaiting
sfnotices
sfspecialranks
sfuseractivitytype
sfuseractivity
sfcache
sfadminkeywords
sfadmintasks

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Moody
Member
sp_UserOfflineSmall Offline
Jan 15, 2018 - 6:25 am

Hi,

This is a list with the sf tables I have after a clean install.

Ooh I have added the forum with the script above.

 

Regards,

list-sf-tables.PNG

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10126
Posts: 79622