Body: <p>Drupal 10.2.3 ,  CiviCRM 5.70.0, PHP 8.2.13, MySQL: 10.6.16-MariaDB-0ubuntu0.22.04.1, nginx/1.18.0</p>
  <p>Got the below in logs after almost each contribution (contributions status=&quot;Completed&quot; ) :</p>
  <blockquote>
  <p>[debug] Could not find an entry for x_subscription_id
  [info] Contribution 12345 updated successfully
  [info] Contribution 12345 Receipt sent</p>
  </blockquote>
  <p>and</p>
  <blockquote>
  <p>[info] Retrying after Database deadlock encountered hit on attempt 1 at query : INSERT INTO civicrm_mailing_recipients (mailing_id, contact_id, email_id)
  SELECT 269, i.contact_id, i.email_id
  FROM civicrm_contact contact_a
  INNER JOIN civicrm_tmp_e_inrecipient_2d90d485a4c12b028bd5ce7fd27ee064 i ON contact_a.id = i.contact_id
  INNER JOIN civicrm_email e ON e.id = i.email_id
  WHERE (( 1 ))
  GROUP BY e.email
  ORDER BY MIN(i.contact_id), MIN(i.email_id)</p>
  </blockquote>
  <p>There are mentions of thr  <strong>x_subscription_id</strong> is  <a href="https://civicrm.stackexchange.com/search?q=x_subscription_id">from 2017 and related to Authorize.net payment processor.</a>  so this might be somehow related to receipts processing but it is not quite clear for me if maybe we should check the database configuration &amp; performance bottlenecks first. Please advice.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-18T17:58:50.847Z
Comments.Text: Do you have any extension that creates mailing upon the submission?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-18T18:20:41.900Z
Comments.Text: None to my knowledge, got rid of Rules etc., and all mailings are being managed manually. Smart group(-s) perhaps?
Comments.UserDisplayName: yurg
Tags: <database><mysql><authorize.net><deadlocks>
Title: Retrying after Database deadlock encountered hit on attempt 1 at query : INSERT INTO civicrm_mailing_recipients?
ThreadText: # Retrying after Database deadlock encountered hit on attempt 1 at query : INSERT INTO civicrm_mailing_recipients?
  
  (Asked by: username_0 on 2024-02-18)
  
  Drupal 10.2.3 , CiviCRM 5.70.0, PHP 8.2.13, MySQL: 10.6.16-MariaDB-0ubuntu0.22.04.1, nginx/1.18.0
  
  Got the below in logs after almost each contribution (contributions status="Completed" ) :
  
  > [debug] Could not find an entry for x\_subscription\_id
  > [info] Contribution 12345 updated successfully
  > [info] Contribution 12345 Receipt sent
  
  and
  
  > [info] Retrying after Database deadlock encountered hit on attempt 1 at query : INSERT INTO civicrm\_mailing\_recipients (mailing\_id, contact\_id, email\_id)
  > SELECT 269, i.contact\_id, i.email\_id
  > FROM civicrm\_contact contact\_a
  > INNER JOIN civicrm\_tmp\_e\_inrecipient\_2d90d485a4c12b028bd5ce7fd27ee064 i ON contact\_a.id = i.contact\_id
  > INNER JOIN civicrm\_email e ON e.id = i.email\_id
  > WHERE (( 1 ))
  > GROUP BY e.email
  > ORDER BY MIN(i.contact\_id), MIN(i.email\_id)
  
  There are mentions of thr **x\_subscription\_id** is [from 2017 and related to Authorize.net payment processor.](https://civicrm.stackexchange.com/search?q=x_subscription_id) so this might be somehow related to receipts processing but it is not quite clear for me if maybe we should check the database configuration & performance bottlenecks first. Please advice.
  
  **Tags:** database, mysql, authorize.net, deadlocks
  
  > **Comments:**
  > **username_1**: Do you have any extension that creates mailing upon the submission?  
  > **username_0**: None to my knowledge, got rid of Rules etc., and all mailings are being managed manually. Smart group(-s) perhaps?  
  
  ---
  
  ## 0 answers
  
  