Support » Plugin: GiveWP - Donation Plugin and Fundraising Platform » Fatal Error: Query failed in database

  • Resolved presswizards


    My client has this error, is it caused in 2.9.4? I see an existing bug filed on already, but specifically want to know if I can roll back the plugin to resolve this. They are manually adding then changing the donor on a donation to log phone or postal mail donations it seems.

    In this case, WordPress caught an error with one of your plugins, Give – Donation Plugin.

    First, visit your website ( and check for any visible issues. Next, visit the page where the error was caught ( and check for any visible issues.

    Please contact your host for assistance with investigating this issue further.

    If your site appears broken and you can’t access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.

    To keep your site safe, this link will expire in 1 day. Don’t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

    When seeking help with this issue, you may be asked for some of the following information:
    WordPress version 5.5.3
    Current theme: Bethlehem (version 1.4.10)
    Current plugin: Give – Donation Plugin (version 2.9.4)
    PHP version 7.3.23

    Error Details
    An error of type E_ERROR was caused in line 32 of the file /home/user/public_html/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php. Error message: Uncaught Give\Framework\Database\Exceptions\DatabaseQueryException: Query failed in database in /home/user/public_html/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php:32
    Stack trace:
    #0 /home/user/public_html/wp-content/plugins/give/src/Framework/Database/DB.php(79): Give\Framework\Database\Exceptions\DatabaseQueryException::create(Array)
    #1 /home/user/public_html/wp-content/plugins/give/src/Framework/Database/DB.php(49): Give\Framework\Database\DB::runQueryWithErrorChecking(Object(Closure))
    #2 /home/user/public_html/wp-content/plugins/give/src/Revenue/Repositories/Revenue.php(62): Give\Framework\Database\DB::delete(‘wp_25057242_giv…’, Array, Array)
    #3 /home/user/public_html/wp-content/plugins/give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php(39): Give\Revenue\Repositories\Revenue->deleteByDonationId(30502)
    #4 [internal function]: Give\Revenue\Listeners\DeleteRevenueWhenDonationDeleted->__invoke(30502)
    #5 /home/user/public_html/wp-co

    • This topic was modified 1 month, 3 weeks ago by presswizards. Reason: Did not mean to link to was just redacting client domain, revised

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Matheus Martins


    Hey @presswizards,

    Happy to help you!

    When we released GiveWP 2.9.0, we needed to create a new database table for revenue, and then move some data to this table. What happened though is that, in specific scenarios, the server refused to create the table. This is possibly what happened to your website.

    What you need to do to fix this issue is to recreate the database table using GiveWP 2.9.4, you don’t need to rollback.

    What you’d need to do to fix this issue is (after changing the domain) go to:
    – Then run the update that becomes available after going to the last link

    If you face any issue during the database updates, you’ll need to check the logs under Donations > Tools > Logs > Updates. There will be information about the errors that may happen, like a donation not assigned to a donation form, for example. To fix it, you’ll need to assign that donation to a form by navigating to Donations > Donations > Click on the donation that is missing the form > Assing a new form to it.

    Please let us know if you have further questions on this or need any additional assistance!

    I ran those links, then clicked Update.

    Got this:

    An unexpected issue occurred during the database update which caused it to stop automatically. Please contact support for assistance.

    Looks at logs, found two entries with donations with deleted forms, assigned to new forms. Reran update, still errors, from the error log:

    Update Task
    Total update count: 0
    Update IDs: Array
    Update: Array
    [update_info] => Array
    [id] => add-past-donation-data-to-revenue-table
    [version] => 2.9.0
    [callback] => Array
    [0] => Give\Revenue\Migrations\AddPastDonationsToRevenueTable Object

    [1] => run

    [type] => database

    [step] => 1
    [update] => 1
    [heading] => Update 1 of 1
    [percentage] => 0
    [total_percentage] => 0

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.