Title: Database error Column &#8216;country_iso_code&#8217; cannot be null
Last modified: May 16, 2022

---

# Database error Column ‘country_iso_code’ cannot be null

 *  Resolved [Muslim](https://wordpress.org/support/users/immuslim/)
 * (@immuslim)
 * [4 years ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/)
 * Hi, I have WP Defender installed on multiple sites and I’m getting errors related
   to the ‘country_iso_code’ column on all of them. Flooding the error logs of each
   site. Here are what some of the errors looks like:
 * [16-May-2022 01:28:33 UTC] WordPress database error Column ‘country_iso_code’
   cannot be null for query INSERT INTO`wp_defender_lockout_log`(`id`,`log`,`ip`,`
   date`,`user_agent`,`type`,`blog_id`,`tried`,`country_iso_code`) VALUES (NULL,‘
   Locked out due to attempted login with banned user agent’, ‘51.222.253.8’, ‘1652664513’,‘
   mozilla/5.0 (compatible; ahrefsbot/7.0; +http://ahrefs.com/robot/)’, ‘ua_lockout’,
   1, ‘mozilla/5.0 (compatible; ahrefsbot/7.0; +http://ahrefs.com/robot/)’, NULL)
   made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘
   wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook-
   >do_action, WP_Hook->apply_filters, WP_Defender\Bootstrap->init_modules, DI\Container-
   >get, DI\Container->resolveDefinition, DI\Definition\Resolver\ResolverDispatcher-
   >resolve, DI\Definition\Resolver\ObjectCreator->resolve, DI\Definition\Resolver\
   ObjectCreator->createInstance, WP_Defender\Controller\Firewall->__construct, 
   WP_Defender\Controller\Firewall->maybe_lockout, WP_Defender\Component\User_Agent-
   >block_user_agent_or_ip, WP_Defender\Component\User_Agent->log_event, WP_Defender\
   DB->save, Calotes\DB\Mapper->save
 * [16-May-2022 01:52:33 UTC] WordPress database error Column ‘country_iso_code’
   cannot be null for query INSERT INTO`wp_defender_lockout_log`(`id`,`log`,`ip`,`
   date`,`user_agent`,`type`,`blog_id`,`tried`,`country_iso_code`) VALUES (NULL,‘
   Failed login attempt with username censored’, ‘134.209.231.225’, ‘1652665953’,‘
   Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149
   Safari/537.36’, ‘auth_fail’, 1, ‘censored’, NULL) made by wp_signon, wp_authenticate,
   do_action(‘wp_login_failed’), WP_Hook->do_action, WP_Hook->apply_filters, WP_Defender\
   Component\Login_Lockout->process_fail_attempt, WP_Defender\Component\Login_Lockout-
   >log_event, WP_Defender\DB->save, Calotes\DB\Mapper->save
    -  This topic was modified 4 years ago by [Muslim](https://wordpress.org/support/users/immuslim/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [4 years ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/#post-15649422)
 * Hi [@immuslim](https://wordpress.org/support/users/immuslim/)
 * I hope you’re well today!
 * Our developers are already aware of the issue and are working on a permanent 
   fix but the good news is that the issue itself shouldn’t affect how your site
   works anyway.
 * It’s related to upgrade and should happen only once or just for a short while
   as it’s related to the way the DB structure is altered upon update (our developers
   will improve the code so it wouldn’t be happening upon future upgrades).
 * If it’s not happening all the time over and over again, you can safely ignore
   it for now.
 * If it’s a continuous “flow” of that error, please let me know and I’ll discuss
   that with our developers.
 * Kind regards,
    Adam
 *  Thread Starter [Muslim](https://wordpress.org/support/users/immuslim/)
 * (@immuslim)
 * [4 years ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/#post-15652557)
 * Thank you for your reply Adam. I hope you are doing good as well.
 * It does look like the error is consistently occurring every time a failed login
   or lockout is logged to the DB. So I definitely think it needs to be permanently
   fixed.
 * WP Defender is such a great plugin and fixing this issue will only make it even
   better. A big thanks to all the good guys behind it. Please keep up the great
   work.
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/#post-15721974)
 * Hi [@immuslim](https://wordpress.org/support/users/immuslim/)
 * We would like to inform you this issue was fixed in the 2.8.3 version. Please
   update Defender and let us know about the results.
 * Kind Regards,
    Kris
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/#post-15742848)
 * Hi [@immuslim](https://wordpress.org/support/users/immuslim/),
 * Since we haven’t heard from you for a while. I’ll mark this thread as resolved
   for now. Please feel free to re-open the thread if you need further assistance.
 * Best Regards
    Nithin

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Database error Column ‘country_iso_code’ cannot be null’ is closed to
new replies.

 * ![](https://ps.w.org/defender-security/assets/icon-256x256.gif?rev=3435930)
 * [Defender Security - Malware Scanner, Login Security & Firewall](https://wordpress.org/plugins/defender-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/defender-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/defender-security/)
 * [Active Topics](https://wordpress.org/support/plugin/defender-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/defender-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/defender-security/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/database-error-column-country_iso_code-cannot-be-null/#post-15742848)
 * Status: resolved