Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2221

CiviMailing Fails with duplicate entry error before sending

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.7, 1.8
    • Fix Version/s: None
    • Component/s: CiviMail
    • Labels:
      None

      Description

      When CiviMail is scheduled to send mails with Include Groups and Exclude groups selected. The mailing fails with the following error.

      ________________________________________________________________________________________
      Sorry. A non-recoverable error has occurred. <p></p>
      <p>Database Error Code: Duplicate entry '23' for key 1, 1062</p>
      <p><a href="http://abc.org/administrator/" title="Main Menu">Return to CiviCRM menu.</a></p>
      </dd>
      </dl>
      </div>

      </div>
      </body>
      </html><p>Error Details:</p><p><pre>Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -5
      [message] => DB Error: already exists
      [mode] => 16
      [debug_info] => INSERT INTO X_43 (contact_id)
      SELECT civicrm_group_contact.contact_id
      FROM civicrm_group_contact
      INNER JOIN civicrm_mailing_group
      ON civicrm_group_contact.group_id = civicrm_mailing_group.entity_id AND civicrm_mailing_group.entity_table = 'civicrm_group'
      WHERE
      civicrm_mailing_group.mailing_id = 40
      AND civicrm_group_contact.status = 'Added'
      AND civicrm_mailing_group.group_type = 'Exclude' [nativecode=1062 ** Duplicate entry '23' for key 1]
      [type] => DB_Error
      [user_info] => INSERT INTO X_43 (contact_id)
      SELECT civicrm_group_contact.contact_id
      FROM civicrm_group_contact
      INNER JOIN civicrm_mailing_group
      ON civicrm_group_contact.group_id = civicrm_mailing_group.entity_id AND civicrm_mailing_group.entity_table = 'civicrm_group'
      WHERE
      civicrm_mailing_group.mailing_id = 40
      AND civicrm_group_contact.status = 'Added'
      AND civicrm_mailing_group.group_type = 'Exclude' [nativecode=1062 ** Duplicate entry '23' for key 1]
      [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO X_43 (contact_id)
      SELECT civicrm_group_contact.contact_id
      FROM civicrm_group_contact
      INNER JOIN civicrm_mailing_group
      ON civicrm_group_contact.group_id = civicrm_mailing_group.entity_id AND civicrm_mailing_group.entity_table = 'civicrm_group'
      WHERE
      civicrm_mailing_group.mailing_id = 40
      AND civicrm_group_contact.status = 'Added'
      AND civicrm_mailing_group.group_type = 'Exclude' [nativecode=1062 ** Duplicate entry '23' for key 1]"]
      )
      </pre></p><p></p>
      _________________________________________________________________________________________________

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              claudian@webaccess.co.in Claudian Fernandes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: