• Resolved deeman001

    (@deeman001)


    When attempting to activate a new install of Wordfence, I get the following error:
    I’ve attempted some of the suggestions such as uninstalling and using the wordfence assistant, though even after removing all tables and data I still get this error.

    Fatal error: Uncaught Exception: Table ‘wp_xxxxx.rFa9lj_wfConfig’ doesn’t exist
    in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/wp-includes/wp-db.php on line 2056

    Call stack:

    mysqli_query()
    wp-includes/wp-db.php:2056
    wpdb::_do_query()
    wp-includes/wp-db.php:1945
    wpdb::query()
    wp-content/plugins/query-monitor/wp-content/db.php:103
    QM_DB::query()
    wp-includes/wp-db.php:2695
    wpdb::get_results()
    wp-content/plugins/wordfence/lib/wfConfig.php:290
    wfConfig::loadAllOptions()
    wp-content/plugins/wordfence/lib/wfConfig.php:368
    wfConfig::hasCachedOption()
    wp-content/plugins/wordfence/lib/wfConfig.php:520
    wfConfig::get()
    wp-content/plugins/wordfence/lib/wfCredentialsController.php:12
    wfCredentialsController::allowLegacy2FA()
    wp-content/plugins/wordfence/lib/wfCredentialsController.php:16
    wfCredentialsController::useLegacy2FA()
    wp-content/plugins/wordfence/lib/wordfenceClass.php:48
    require_once()
    wp-content/plugins/wordfence/wordfence.php:115
    include_once()
    wp-admin/includes/plugin.php:2286
    plugin_sandbox_scrape()
    wp-admin/plugins.php:191

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same problem here. Deactivated all plugins and still unable to install

    Fatal error: Uncaught mysqli_sql_exception: Table 'xxxxxxxxxxxxx.wpth_wfConfig' doesn't exist in xxxxxxxxxxxxx/wp-includes/wp-db.php:2056 Stack trace: #0 xxxxxxxxxxxxx/wp-includes/wp-db.php(2056): mysqli_query() #1 xxxxxxxxxxxxx/wp-includes/wp-db.php(1945): wpdb->_do_query() #2 xxxxxxxxxxxxx/wp-includes/wp-db.php(2695): wpdb->query() #3 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wfConfig.php(290): wpdb->get_results() #4 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wfConfig.php(368): wfConfig::loadAllOptions() #5 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wfConfig.php(520): wfConfig::hasCachedOption() #6 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wfCredentialsController.php(12): wfConfig::get() #7 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wfCredentialsController.php(16): wfCredentialsController::allowLegacy2FA() #8 xxxxxxxxxxxxx/wp-content/plugins/wordfence/lib/wordfenceClass.php(48): wfCredentialsController::useLegacy2FA() #9 xxxxxxxxxxxxx/wp-content/plugins/wordfence/wordfence.php(115): require_once('xxxxxxxxxxxxx') #10 xxxxxxxxxxxxx/wp-admin/includes/plugin.php(2286): include_once('xxxxxxxxxxxxx') #11 xxxxxxxxxxxxx/wp-admin/plugins.php(191): plugin_sandbox_scrape() #12 {main} thrown in xxxxxxxxxxxxx/wp-includes/wp-db.php on line 2056

    Thread Starter deeman001

    (@deeman001)

    @kevinagar I was able to get mine to activate. I tried every method that was proposed on the forums, so I threw a hale mary and exported the SQL create structure of the ‘wfconfig’ table (notice it’s a lowercase ‘c’onfig) from a different site that had this plugin working. I then imported that ‘wfconfig’ SQL into my server to create the table and changed the name to include the upercase ‘C’ to ‘wfConfig’. It activated without an issue and is working perfectly.

    I hope this helps.

    @deeman001 Thank you very much for your reply. It took me a while to find how to edit the name but I finally got there and, like you, it solved the problem. Again, thank you

    Steph

    (@sglaserliventus)

    We are having this issue as well. Is there any update on an actual fix from Wordfence?

    Thread Starter deeman001

    (@deeman001)

    @sglaserliventus I’ve not heard anything from WordFence on my original post. They have some archived forum posts which helped some users, but didn’t help me, so I just manually recreated the table and structure myself.

    • This reply was modified 2 years, 10 months ago by deeman001.
    Steph

    (@sglaserliventus)

    I’ve opened a direct ticket with Wordfence and they are looking into the issue. @deeman001 can you provide details on what your system is running so I can add that to the ticket?

    Our environment where the issue occurred (installing trying to use the old camelCase style) is running…
    PHP 8.1.0
    nginx/1.18.0 (Ubuntu)
    MySQL 8.0.27-0ubuntu0.20.04.1

    Our local environment where it installed correctly using lowercase is running…
    PHP v7.4.1
    Apache
    MySQL 5.7.24

    I’m wondering if it could be related to any of these differences.

    I also got trouble to install it, the error message was the same. Sadly i cant use any “donor” wordpress installation.
    Whats worked for me is that i found the database shema in this file:
    /lib/wfSchema.php
    Fron the line private static $tables = array(

    You have to convert the php array to sql (basically copy the array and edit the first and the last line, for example: "wfBlocks7" => "( to CREATE TABLE wp_wfBlocks7 ( , and delete the closing ‘”‘.

    Here is the entire schema (NOTICE: i used the 7.5.11 version):

    CREATE TABLE wp_wfBlocks7 (
      <code>id</code> bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      <code>type</code> int(10) unsigned NOT NULL DEFAULT '0',
      <code>IP</code> binary(16) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
      <code>blockedTime</code> bigint(20) NOT NULL,
      <code>reason</code> varchar(255) NOT NULL,
      <code>lastAttempt</code> int(10) unsigned DEFAULT '0',
      <code>blockedHits</code> int(10) unsigned DEFAULT '0',
      <code>expiration</code> bigint(20) unsigned NOT NULL DEFAULT '0',
      <code>parameters</code> text,
      PRIMARY KEY (<code>id</code>),
      KEY <code>type</code> (<code>type</code>),
      KEY <code>IP</code> (<code>IP</code>),
      KEY <code>expiration</code> (<code>expiration</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfConfig (
      <code>name</code> varchar(100) NOT NULL,
      <code>val</code> longblob,
      <code>autoload</code> enum('no','yes') NOT NULL DEFAULT 'yes',
      PRIMARY KEY (<code>name</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfCrawlers (
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>patternSig</code> binary(16) NOT NULL,
      <code>status</code> char(8) NOT NULL,
      <code>lastUpdate</code> int(10) unsigned NOT NULL,
      <code>PTR</code> varchar(255) DEFAULT '',
      PRIMARY KEY (<code>IP</code>,<code>patternSig</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfFileChanges (
      <code>filenameHash</code> char(64) NOT NULL,
      <code>file</code> varchar(1000) NOT NULL,
      <code>md5</code> char(32) NOT NULL,
      PRIMARY KEY (<code>filenameHash</code>)
    ) CHARSET=utf8;
    CREATE TABLE wp_wfHits (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>attackLogTime</code> double(17,6) unsigned NOT NULL,
      <code>ctime</code> double(17,6) unsigned NOT NULL,
      <code>IP</code> binary(16) DEFAULT NULL,
      <code>jsRun</code> tinyint(4) DEFAULT '0',
      <code>statusCode</code> int(11) NOT NULL DEFAULT '200',
      <code>isGoogle</code> tinyint(4) NOT NULL,
      <code>userID</code> int(10) unsigned NOT NULL,
      <code>newVisit</code> tinyint(3) unsigned NOT NULL,
      <code>URL</code> text,
      <code>referer</code> text,
      <code>UA</code> text,
      <code>action</code> varchar(64) NOT NULL DEFAULT '',
      <code>actionDescription</code> text,
      <code>actionData</code> text,
      PRIMARY KEY (<code>id</code>),
      KEY <code>k1</code> (<code>ctime</code>),
      KEY <code>k2</code> (<code>IP</code>,<code>ctime</code>),
      KEY <code>attackLogTime</code> (<code>attackLogTime</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfIssues (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>time</code> int(10) unsigned NOT NULL,
      <code>lastUpdated</code> int(10) unsigned NOT NULL,
      <code>status</code> varchar(10) NOT NULL,
      <code>type</code> varchar(20) NOT NULL,
      <code>severity</code> tinyint(3) unsigned NOT NULL,
      <code>ignoreP</code> char(32) NOT NULL,
      <code>ignoreC</code> char(32) NOT NULL,
      <code>shortMsg</code> varchar(255) NOT NULL,
      <code>longMsg</code> text,
      <code>data</code> text,
      PRIMARY KEY (<code>id</code>),
      KEY <code>lastUpdated</code> (<code>lastUpdated</code>),
      KEY <code>status</code> (<code>status</code>),
      KEY <code>ignoreP</code> (<code>ignoreP</code>),
      KEY <code>ignoreC</code> (<code>ignoreC</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfPendingIssues (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>time</code> int(10) unsigned NOT NULL,
      <code>lastUpdated</code> int(10) unsigned NOT NULL,
      <code>status</code> varchar(10) NOT NULL,
      <code>type</code> varchar(20) NOT NULL,
      <code>severity</code> tinyint(3) unsigned NOT NULL,
      <code>ignoreP</code> char(32) NOT NULL,
      <code>ignoreC</code> char(32) NOT NULL,
      <code>shortMsg</code> varchar(255) NOT NULL,
      <code>longMsg</code> text,
      <code>data</code> text,
      PRIMARY KEY (<code>id</code>),
      KEY <code>lastUpdated</code> (<code>lastUpdated</code>),
      KEY <code>status</code> (<code>status</code>),
      KEY <code>ignoreP</code> (<code>ignoreP</code>),
      KEY <code>ignoreC</code> (<code>ignoreC</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfTrafficRates (
      <code>eMin</code> int(10) unsigned NOT NULL,
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>hitType</code> enum('hit','404') NOT NULL DEFAULT 'hit',
      <code>hits</code> int(10) unsigned NOT NULL,
      PRIMARY KEY (<code>eMin</code>,<code>IP</code>,<code>hitType</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfLocs (
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>ctime</code> int(10) unsigned NOT NULL,
      <code>failed</code> tinyint(3) unsigned NOT NULL,
      <code>city</code> varchar(255) DEFAULT '',
      <code>region</code> varchar(255) DEFAULT '',
      <code>countryName</code> varchar(255) DEFAULT '',
      <code>countryCode</code> char(2) DEFAULT '',
      <code>lat</code> float(10,7) DEFAULT '0.0000000',
      <code>lon</code> float(10,7) DEFAULT '0.0000000',
      PRIMARY KEY (<code>IP</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfLogins (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>hitID</code> int(11) DEFAULT NULL,
      <code>ctime</code> double(17,6) unsigned NOT NULL,
      <code>fail</code> tinyint(3) unsigned NOT NULL,
      <code>action</code> varchar(40) NOT NULL,
      <code>username</code> varchar(255) NOT NULL,
      <code>userID</code> int(10) unsigned NOT NULL,
      <code>IP</code> binary(16) DEFAULT NULL,
      <code>UA</code> text,
      PRIMARY KEY (<code>id</code>),
      KEY <code>k1</code> (<code>IP</code>,<code>fail</code>),
      KEY <code>hitID</code> (<code>hitID</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfReverseCache (
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>host</code> varchar(255) NOT NULL,
      <code>lastUpdate</code> int(10) unsigned NOT NULL,
      PRIMARY KEY (<code>IP</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfStatus (
      <code>id</code> bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      <code>ctime</code> double(17,6) unsigned NOT NULL,
      <code>level</code> tinyint(3) unsigned NOT NULL,
      <code>type</code> char(5) NOT NULL,
      <code>msg</code> varchar(1000) NOT NULL,
      PRIMARY KEY (<code>id</code>),
      KEY <code>k1</code> (<code>ctime</code>),
      KEY <code>k2</code> (<code>type</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfHoover (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>owner</code> text,
      <code>host</code> text,
      <code>path</code> text,
      <code>hostKey</code> varbinary(124) DEFAULT NULL,
      PRIMARY KEY (<code>id</code>),
      KEY <code>k2</code> (<code>hostKey</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfFileMods (
      <code>filenameMD5</code> binary(16) NOT NULL,
      <code>filename</code> varchar(1000) NOT NULL,
      <code>knownFile</code> tinyint(3) unsigned NOT NULL,
      <code>oldMD5</code> binary(16) NOT NULL,
      <code>newMD5</code> binary(16) NOT NULL,
      <code>SHAC</code> binary(32) NOT NULL DEFAULT '00000000000000000000000000000000',
      <code>stoppedOnSignature</code> varchar(255) NOT NULL DEFAULT '',
      <code>stoppedOnPosition</code> int(10) unsigned NOT NULL DEFAULT '0',
      <code>isSafeFile</code> varchar(1) NOT NULL DEFAULT '?',
      PRIMARY KEY (<code>filenameMD5</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfBlockedIPLog (
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>countryCode</code> varchar(2) NOT NULL,
      <code>blockCount</code> int(10) unsigned NOT NULL DEFAULT '0',
      <code>unixday</code> int(10) unsigned NOT NULL,
      <code>blockType</code> varchar(50) NOT NULL DEFAULT 'generic',
      PRIMARY KEY (<code>IP</code>,<code>unixday</code>,<code>blockType</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfSNIPCache (
      <code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT,
      <code>IP</code> varchar(45) NOT NULL DEFAULT '',
      <code>expiration</code> timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
      <code>body</code> varchar(255) NOT NULL DEFAULT '',
      <code>count</code> int(10) unsigned NOT NULL DEFAULT '0',
      <code>type</code> int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (<code>id</code>),
      KEY <code>expiration</code> (<code>expiration</code>),
      KEY <code>IP</code> (<code>IP</code>),
      KEY <code>type</code> (<code>type</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfKnownFileList (
      <code>id</code> int(11) unsigned NOT NULL AUTO_INCREMENT,
      <code>path</code> text NOT NULL,
      PRIMARY KEY (<code>id</code>)
    ) DEFAULT CHARSET=utf8;
    CREATE TABLE wp_wfNotifications (
      <code>id</code> varchar(32) NOT NULL DEFAULT '',
      <code>new</code> tinyint(3) unsigned NOT NULL DEFAULT '1',
      <code>category</code> varchar(255) NOT NULL,
      <code>priority</code> int(11) NOT NULL DEFAULT '1000',
      <code>ctime</code> int(10) unsigned NOT NULL,
      <code>html</code> text NOT NULL,
      <code>links</code> text NOT NULL,
      PRIMARY KEY (<code>id</code>)
    ) DEFAULT CHARSET=utf8;;
    CREATE TABLE wp_wfLiveTrafficHuman (
      <code>IP</code> binary(16) NOT NULL DEFAULT '0000000000000000',
      <code>identifier</code> binary(32) NOT NULL DEFAULT '00000000000000000000000000000000',
      <code>expiration</code> int(10) unsigned NOT NULL,
      PRIMARY KEY (<code>IP</code>,<code>identifier</code>),
      KEY <code>expiration</code> (<code>expiration</code>)
    ) DEFAULT CHARSET=utf8;
    • This reply was modified 2 years, 4 months ago by peterlukacs.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error Table wfConfig doesn’t exist when activating Wordfence’ is closed to new replies.