Title: Problem upgrading database after plugin update
Last modified: March 23, 2021

---

# Problem upgrading database after plugin update

 *  Resolved [robhilken](https://wordpress.org/support/users/robhilken/)
 * (@robhilken)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/)
 * Hi,
 * I am getting an error when trying to upgrade the database after updating the 
   plugin.
 * When I hit ‘Pause update’ this is the error I get:
 *     ```
       Fatal error: Uncaught Give\Framework\Database\Exceptions\DatabaseQueryException: Query failed in database in /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php:32 Stack trace: #0 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/DB.php(122): Give\Framework\Database\Exceptions\DatabaseQueryException::create(Array) #1 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/DB.php(81): Give\Framework\Database\DB::runQueryWithErrorChecking(Object(Closure)) #2 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Log/LogRepository.php(51): Give\Framework\Database\DB::__callStatic('insert', Array) #3 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Log/LogModel.php(238): Give\Log\LogRepository->insertLog(Object(Give\Log\LogModel)) #4 /homepages/26/d236260425/htdocs/wp-content/plugins/give/includes/class-give-logging.php(218): Give\Log\LogModel->save() #5 /homepages/26/d236260425/htdocs/wp-conten in /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 32
       There has been a critical error on this website. Please check your site admin email inbox for instructions.
       ```
   

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

 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/#post-14224593)
 * Hi [@robhilken](https://wordpress.org/support/users/robhilken/),
 * We are working currently to isolate some edge case database migration issues 
   that affect a handful of sites, especially ones with a long donation history.
   
   Do you have a staging site or test site where you can replicate this issue? That
   would be immensely helpful in getting to the bottom of this.
 * Please send credentials through our contact form (do not post credentials on 
   this public forum): [https://givewp.com/contact-us/](https://givewp.com/contact-us/)
 * Also, if you can turn on WP_DEBUG mode on that staging site, that would be excellent:
 *     ```
       // Turn debugging on
       define('WP_DEBUG', true);
   
       // Tell WordPress to log everything to /wp-content/debug.log
       define('WP_DEBUG_LOG', true);
   
       // Turn off the display of error messages on your site
       define('WP_DEBUG_DISPLAY', false);
       ```
   
 * In the meantime, if your site is still able to accept donations, you should be
   OK to ignore the warnings/errors, and we’ll keep you posted on updates to fix
   these issues.
 *  Thread Starter [robhilken](https://wordpress.org/support/users/robhilken/)
 * (@robhilken)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/#post-14224701)
 * HI,
 * We don’t have a staging server, unfortunately.
 * We had to disable the plugin as we were unable to edit any content on the site
   as it gave us a fatal error when trying to edit.
 *     ```
       Fatal error: Uncaught Give\Framework\Database\Exceptions\DatabaseQueryException: Query failed in database in /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php:32 Stack trace: #0 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/DB.php(122): Give\Framework\Database\Exceptions\DatabaseQueryException::create(Array) #1 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/DB.php(81): Give\Framework\Database\DB::runQueryWithErrorChecking(Object(Closure)) #2 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/MigrationLog/MigrationLogRepository.php(70): Give\Framework\Database\DB::__callStatic('get_results', Array) #3 /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/MigrationLog/Helpers/MigrationHelper.php(47): Give\MigrationLog\MigrationLogRepository->getMigrations() #4 [internal function]: Give\MigrationLog\Helpers\MigrationHelper->__construct(Object(Give\Framework\Migrations\MigrationsRe in /homepages/26/d236260425/htdocs/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 32
       There has been a critical error on this website. Please check your site admin email inbox for instructions.
       ```
   
 * We did not have a long history of donations…
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/#post-14225692)
 * [@robhilken](https://wordpress.org/support/users/robhilken/)
 * Thanks for the update.
 * We’re investigating this and we will update as soon as possible.
 * Thanks!
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/#post-14255145)
 * Hi there,
 * What’s going on here is a combination of two different issues that are conspiring
   to make for this particular fatal error.
 * The first issue is that upon updating to 2.10.0 of GiveWP your site should have
   generated a new database table to track migrations (changes made within the GiveWP
   database tables). That procedure failed on your site, and didn’t create the database
   table that is accessed with the get_migrations() function referenced in step #
   3 of that error message.
 * So when the site goes looking for a table and there’s not one there, it’s currently
   not handling that very well.
 * The next issue your error message helped us uncover is that GiveWP get_migration()
   checks shouldn’t be happening at all upon creation of Posts and Pages. We’ve 
   already isolated the cause of that, and are working on a fix for it. You can 
   provide additional details or track the progress of the feedback here:
    [https://feedback.givewp.com/bug-reports/p/migrations-constructors-should-not-run-during-postpage-creation](https://feedback.givewp.com/bug-reports/p/migrations-constructors-should-not-run-during-postpage-creation)
 * On other sites, it’s just harmlessly going to check the migrations on every post
   or page creation. On yours, it’s breaking altogether, because there’s not a table
   there to check those migrations.
 * So the first fix is to determine what on your specific site is preventing the
   creation of that migrations table. We’ve got a small handful of other reports
   of this and can make a few guesses, but ultimately we need to check the error
   logs for clues.
 * Here’s a plugin that should allow you to check the debug logs for clues: [https://wordpress.org/plugins/error-log-viewer/](https://wordpress.org/plugins/error-log-viewer/)
 * Follow the instructions there for checking the debug log and pass along any error
   message you see.
 * One thing that we think may be causing these issues is sites running old versions
   of MySQL (older than 5.7). We’re in the process of making sure that the database
   migration and tools are all backward compatible to version 5.6, but if you are
   running an older version than that, you’ll need to update that and your host 
   can help.
 * Here’s the feedback for that issue where you can follow along: [https://feedback.givewp.com/bug-reports/p/givewp-database-management-tools-should-be-backward-compatible-to-mysql-56](https://feedback.givewp.com/bug-reports/p/givewp-database-management-tools-should-be-backward-compatible-to-mysql-56)
 * Once you get that database table created, you should be good to go, and then 
   our fix to prevent it from even trying to check migrations will fully resolve
   things.

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

The topic ‘Problem upgrading database after plugin update’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [database update](https://wordpress.org/support/topic-tag/database-update/)

 * 4 replies
 * 2 participants
 * Last reply from: [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/problem-upgrading-database-after-plugin-update/#post-14255145)
 * Status: resolved