Title: Database error when upgrading
Last modified: March 10, 2023

---

# Database error when upgrading

 *  Resolved [321abc](https://wordpress.org/support/users/deraxia/)
 * (@deraxia)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/database-error-when-upgrading-2/)
 * After updating to the latest version from 4.3.2, my error log is full of these
   errors and the plugin no longer records new data or correctly displays old data
   in the log viewer:
 * `"PHP message: WordPress database error Unknown column 'client_ip' in 'field 
   list' for query SELECT DISTINCT client_ip FROM wp_wsal_occurrences LIMIT 100 
   made by do_action('wp-activity-log_page_wsal-rep-views-main'), WP_Hook->do_action,
   WP_Hook->apply_filters, WSAL_ViewManager->render_view_body, WSAL_AbstractView-
   >render_content, WSAL_Rep_Views_Main->render, include('/plugins/wp-security-audit-
   log-premium/extensions/reports/inc/wsal-reporting-view.inc.php'), WSAL_Rep_Common::
   get_ip_addresses, WSAL\Adapter\WSAL_Adapters_MySQL_Occurrence->get_matching_ips"
   while reading upstream, request: "GET /wp-admin/admin.php?page=wsal-rep-views-
   main HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", referrer:"
   localhost/wp-admin/admin.php?page=wsal-ext-settings&tab=mirroring"
   2023/03/10
   09:55:45 [error] 29595#29595: *1311873 FastCGI sent in stderr: "PHP message: 
   PHP Warning: Undefined array key "client_ip" in /var/www/site/wp-content/plugins/
   wp-security-audit-log-premium/classes/ViewManager.
 * Any help would be appreciated. It seems like the plugin is not updating or recognizing
   the database correctly.

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

 *  Plugin Support [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/database-error-when-upgrading-2/#post-16548034)
 * Thank you for using our plugin [@deraxia](https://wordpress.org/support/users/deraxia/)
 * In update 4.4.0 we have changed the database schema so there is a process that
   needs to run to upgrade the database. Clearly something has gone wrong with the
   upgrade – the fact that you’ve upgraded from a very old version could be the 
   cause.
 * Do you want to keep the activity log or you’re happy to start with a new activity
   log? If it is the latter, you should simply deactivate the plugin, delete the
   plugin tables (_wp\_wsal\_occurrences_ and _wp\_wsal\_metadata_) and activate
   the plugin. That should do the trick.
 * If you’d like to keep the activity log:
    1. Before doing any more changes please backup those tables first as a security
       precaution.
    2. Deactivate and uninstall the plugin.
    3. [Download and install version 4.3.6](https://downloads.wordpress.org/plugin/wp-security-audit-log.4.3.6.zip).
    4. If the logs are looking good [upgrade to 4.4.0](https://downloads.wordpress.org/plugin/wp-security-audit-log.4.4.0.zip)
       and then to the latest version.
 * If the logs are not looking good, even when you upgrade to 4.3.6 message us again.
 * Please keep us posted.
 *  Thread Starter [321abc](https://wordpress.org/support/users/deraxia/)
 * (@deraxia)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/database-error-when-upgrading-2/#post-16548916)
 * Thanks for the response. I followed your steps. I deactivated and uninstalled.
   I installed 4.3.6, then upgraded to 4.4.0, and then the latest version but it
   made no difference. The plugin is still not recognizing or upgrading the database.
 *  Plugin Support [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/database-error-when-upgrading-2/#post-16556923)
 * Hello [@deraxia](https://wordpress.org/support/users/deraxia/)
 * Just to confirm as per my other previous message; when you upgraded to 4.3.6 
   were you still able to see the logs?

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

The topic ‘Database error when upgrading’ is closed to new replies.

 * ![](https://ps.w.org/wp-security-audit-log/assets/icon-256x256.png?rev=2961534)
 * [WP Activity Log](https://wordpress.org/plugins/wp-security-audit-log/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-security-audit-log/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-security-audit-log/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-security-audit-log/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-security-audit-log/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-security-audit-log/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [robertabela](https://wordpress.org/support/users/robert681/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/database-error-when-upgrading-2/#post-16556923)
 * Status: resolved