Database duplicate entry error after stripe webhook request
Does someone know how to resolve this issue?
Our stripe webhook logs show payment_succeeded events as failing. In our civicrm logs we identify after the payment_succeeded event there is a database "already exists" error as shown below:
Dec 16 11:53:07 [error] $Fatal Error Details = Array ( [callback] => Array (  => CRM_Core_Error  => exceptionHandler ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug_info] => INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `contribution_page_id` , `payment_instrument_id` , `receive_date` , `total_amount` , `fee_amount` , `net_amount` , `trxn_id` , `currency` , `source` , `contribution_recur_id` , `is_test` , `contribution_status_id` , `check_number` ) VALUES ... [nativecode=1062 ** Duplicate entry 'in_1Hz3F8JGSpXAfzYGQnAVz4jN' for key 'UI_contrib_trxn_id']"]
The other event type webhooks seem to be working. The result of payment_succeeded not working is our payments are never marked as completed in civicrm rather left as pending. Stripe payment_succeeded was working a couple months ago before we upgraded civicrm and civicrm extensions. We are currently using CivicCRM version 5.30.1, stripe api version of 2020-08-27, com.drastikbydesign.stripe version 6.5.5, and mjwshared 0.9.9.