Support » Plugin: Wordfence Security - Firewall & Malware Scan » WordPress database error Column ‘statusCode’ cannot be null

  • Hello,

    I’m getting this error that many others have gotten. I see hundreds of these errors in my logs for all sorts of warnings in every table… I think my version of Wordfence is corrupted?

    example:

    [17-Sep-2019 16:41:28 UTC] WordPress database error Column ‘statusCode’ cannot be null for query INSERT INTO wp_wfHits (ctime, statusCode, isGoogle, IP, userID, URL, referer, UA, jsRun, id) VALUES (‘1568738488.094598’, NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿ:a•’, ‘0’, ‘https://xxxxxxxxxxxxx.com/spring-cleaning/’, ”, ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 (Applebot/0.1; +http://www.apple.com/go/applebot)’, ”, ‘0’) made by wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert

    Here’s the problem though. I’ve tried re-installing Wordfence by following the removal instructions on this page (https://www.wordfence.com/help/advanced/remove-or-reset/) as instructed by WF support in other threads with this same issue. I’m not certain the removal completely worked; when I re-installed, all my previous settings were remembered. And my problems persist in the error log.

    Any help is appreciated.

    • This topic was modified 8 months, 2 weeks ago by a305587.
    • This topic was modified 8 months, 2 weeks ago by a305587.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support WFGerroald

    (@wfgerald)

    Hey @a305587,

    I believe resetting Wordfence should do the trick. Can you please try once more using the Wordfence Assistant plugin?

    https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset

    Please let me know how it goes.

    Thanks,

    Gerroald

    Hello Gerroald,

    Thanks for your response. The Wordfence Assistant plugin did help with full removal of Wordfence, thank you. However this process of removing and reinstalling Wordfence did not fix our problem.

    Upon further review of the error we’re receiving, I’m not sure it would fix the problem. I think there’s an error in the Wordfence code. Stay with me… We have > 15 websites across multiple servers in which we use your excellent plugin. After we spent more time analyzing our error logs we noticed all of our sites are seeing this error.

    Here’s the error we’re seeing:

    [18-Sep-2019 16:51:47 UTC] WordPress database error Column ‘statusCode’ cannot be null for query INSERT INTO wp_wfHits (ctime, statusCode, isGoogle, IP, userID, URL, referer, UA, jsRun, id) VALUES (‘1568825507.287943’, NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿê*’, ‘0’, ‘https://www.xxxxxxxx.com/’, ”, ‘curl/7.54.0’, ”, ‘0’) made by wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert

    Here’s a screenshot of a look inside phpMyAdmin where this is reflected:
    https://ibb.co/8jQgFk3

    Looking at the error, it’s saying an entry into the database cannot be null. Correct me if I’m wrong, but this sounds like a structural problem within the database setup by Wordfence, not my website.

    Last night I ran a test on one of our sites – I went into the database and changed the settings for the column of ‘statusCode’ to where it CAN be null. Then I reset my error log and have let it run. I was previously getting this error every 2-3 minutes, since I made the change I have had zero errors in the error log. So my fix of allowing ‘statusCode’ column to allow for Null has appeared to fix the problem.
    Problem fixed screenshot: https://ibb.co/j3pWwHd

    My concern is what tangential effects does this have downstream?

    And I don’t want to pretend that you guys didn’t/don’t know about this issue either. If it’s happening to my 15 websites, surely it’s happened to the others of the 3 million+ sites it’s installed on elsewhere.

    I’m curious as to why this happened, if I should continue with my fix on my other sites, the repercussions of this fix, if you recommend I continue with the fix or if you advise against it, etc.

    Thank you for your time!

    Update: I’m still seeing these errors on over a dozen of our sites, the only exception being the site I “cleaned” by updating the table structure to allow for NULL no longer reports the errors.

    Here’s an example:

    [23-Sep-2019 18:25:53 UTC] WordPress database error Column ‘statusCode’ cannot be null for query INSERT INTO wp_wfhits (ctime, statusCode, isGoogle, IP, userID, URL, referer, UA, jsRun, id) VALUES (‘1569263153.148954’, NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿÏúêd’, ‘0’, ‘https://xxxxxxxxxx.com/’, ”, ‘Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) DMBrowser/2.1 (SV)’, ”, ‘0’) made by wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert

    Does WordFence have an idea of what is causing these errors? My logs are ballooning to ridiculous sizes.

    Thank you.

    • This reply was modified 8 months, 1 week ago by a305587.
    Plugin Support WFGerroald

    (@wfgerald)

    Hey @a305587,

    Have you obfuscated the IP in the error you’ve shared, or is it actually \0\0\0\0\0\0\0\0\0\0ÿÿÏúêd? If this is how it’s appearing in the error log can you please try adjusting your How Wordfence Gets Visitors IPs to see if it helps?

    If this doesn’t help can you please send me a Diagnostics report so I can get a better overview of your environment? Please navigate to Wordfence > Tools > Diagnostics. Here you can select SEND REPORT BY EMAIL. Please include your WordPress.org username and update this thread after you’ve sent it.

    Thanks,

    Gerroald

    Thank you Gerroald, I appreciate your time. I have submitted the report via email.

    I did not obfuscate the IP address, it actually comes through as that on the error log. And it appears to do this for most entries. I did obfuscate the URL of my site for public display here (although this will be visible to you in the emailed report).

    I did try changing how WordFence gets IPs to the 2nd option (Use PHP’s built-in REMOTE_ADDR), but this did not appear to fix the issue. When I checked the error log afterward I was still seeing the errors.

    A note on the error logs when you view the emailed report: When I make a change to the settings, I reset the error logs by appending the date to the end of the file. So for example when I tried changing a setting in WordFence on 9/23/19 to test if it fixed the issue, I wanted to reset the error log, so I renamed the old error log “error_log-092319”. I’m explaining this so when you get said report you’ll understand the meaning of all the error logs and the numbers after them. 😉 The error log without a number after it is the current one. Most recent change attempt was me changing how WF gets its IP addresses.

    Thanks again for taking the time to look into this, I appreciate your help sir.

    Plugin Support WFGerroald

    (@wfgerald)

    Hey @a305587,

    My apologies for the delay with this.

    After doing a lot of digging and internal conversations about this we’ve come to the conclusion that this is likely a plugin conflict. Are you able to share a list of your plugin so we can dig a little deeper?

    Please let me know.

    Thanks,

    Gerroald

    Hello Gerroald,

    Thank you for your continuing attention to this matter.

    This particular issue is affecting every site under our purview (~15 sites across multiple servers) and we have a variety of plugins installed on each site. There are overlaps in the plugins used on each site, however there are many differences depending on the website’s mission.

    I’ll pick one site for your query (same one used above from the error log):

    * Advanced Custom Fields PRO
    * Classic Editor
    * Companion Auto Update
    * Custom Post Type UI
    * Ivory Search
    * Jetpack
    * LearnPress
    * Post Snippets
    * Really Simple SSL
    * Shortcoder
    * Simple CSS
    * Slimstat Analytics
    * UpdraftPlus Backup/Restore
    * Wordfence Security
    * WP Crontrol
    * WPForms
    * WPForms Custom Captcha
    * Yoast SEO

    These are the only plugins we have installed on every site (common denominators):

    * Classic Editor
    * Companion Auto Update
    * Really Simple SSL
    * UpdraftPlus Backup/Restore
    * WordFence Security

    Thank you again.

    Plugin Support WFGerroald

    (@wfgerald)

    Hey @a305587,

    Thanks for sharing this. I’ve shared the lists with the developers.

    Are these sites on the same server or hosting?

    Thanks,

    Gerroald

    Hello Gerroald,

    Thank you again for continuing attention. All sites are on a single Bluehost VPS, however they are split between two cPanels. We have control up to WHM level.

    Regards

    • This reply was modified 7 months, 3 weeks ago by a305587.

    We have the exact same problem, same error message, only different results.

    The only plugins in common with above user is:|

    Slimstat Analytics
    Wordfence Security
    Yoast SEO Premium
    Classic Editor

    wp_wfHits is Wordfence related and started September 11th with roughly 12,000 repeated errors in the log over four days.

    [15-Oct-2019 21:25:36 UTC] WordPress database error Column ‘statusCode’ cannot be null for query INSERT INTO wp_wfHits (ctime, statusCode, isGoogle, IP, userID, URL, referer, UA, jsRun) VALUES (‘1571174735.818585’, NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿÀc ‘, ‘0’, ‘https://texontowel.com/c/gym-towels/center-stripe-towels/?add-to-cart=2421&product_view=grid&product_count=32&paged=1’, ”, ‘Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)’, ”) made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, redirect_canonical, wp_redirect, apply_filters(‘wp_redirect_status’), WP_Hook->apply_filters, wordfence::wpRedirectStatusFilter, wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert

    I used Wordfence Assistant to remove all Wordfence Data in the Database and elsewhere and reinstalled. We will see what becomes of the effort.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WordPress database error Column ‘statusCode’ cannot be null’ is closed to new replies.