CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Database Error Code: Duplicate entry '0-1' for key 2, 1062
Pages: [1]

Author Topic: Database Error Code: Duplicate entry '0-1' for key 2, 1062  (Read 1212 times)

crayon

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.2
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Database Error Code: Duplicate entry '0-1' for key 2, 1062
February 18, 2008, 01:09:20 pm
I get the following error message when I try to allow my "new users" (me with different names and emails) to make a donation or become a member.  I fill in the form, cc info and sumbit and get this and I have no idea what it means or what to do:

Sorry. A non-recoverable error has occurred.

Database Error Code: Duplicate entry '0-1' for key 2, 1062

Return to home page.

Error Details:


Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contribution (domain_id , contact_id , contribution_type_id , contribution_page_id , payment_instrument_id , receive_date , non_deductible_amount , total_amount , net_amount , trxn_id , invoice_id , currency , source , amount_level , contribution_status_id ) VALUES ( 1 ,  17478 ,  2 ,  2 ,  1 ,  20080218160418 ,  50.00 ,  50.00 ,  50.00 , '0' , 'c8620db1455f60d6265df46c90b742e9' , 'USD' , 'Online Contribution: EarthSave Membership' ,  NULL ,  1 )  [nativecode=1062 ** Duplicate entry '0-1' for key 2]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contribution (domain_id , contact_id , contribution_type_id , contribution_page_id , payment_instrument_id , receive_date , non_deductible_amount , total_amount , net_amount , trxn_id , invoice_id , currency , source , amount_level , contribution_status_id ) VALUES ( 1 ,  17478 ,  2 ,  2 ,  1 ,  20080218160418 ,  50.00 ,  50.00 ,  50.00 , '0' , 'c8620db1455f60d6265df46c90b742e9' , 'USD' , 'Online Contribution: EarthSave Membership' ,  NULL ,  1 )  [nativecode=1062 ** Duplicate entry '0-1' for key 2]
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contribution (domain_id , contact_id , contribution_type_id , contribution_page_id , payment_instrument_id , receive_date , non_deductible_amount , total_amount , net_amount , trxn_id , invoice_id , currency , source , amount_level , contribution_status_id ) VALUES ( 1 ,  17478 ,  2 ,  2 ,  1 ,  20080218160418 ,  50.00 ,  50.00 ,  50.00 , '0' , 'c8620db1455f60d6265df46c90b742e9' , 'USD' , 'Online Contribution: EarthSave Membership' ,  NULL ,  1 )  [nativecode=1062 ** Duplicate entry '0-1' for key 2]"]
)

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Database Error Code: Duplicate entry '0-1' for key 2, 1062
February 18, 2008, 05:07:24 pm
What version of CiviCRM are you using. There was a problem with Authorize.net "test mode" transactions returning this error in earlier versions of CiviCRM. But it shoudl be fixed as of current stable release (1.9) except for test mode w/ Event Registration which was fixed in 2.0:

http://issues.civicrm.org/jira/browse/CRM-2566

The basic issue is that Authorize.net returns a "transaction ID" of 0 for all test transactions... however this value is supposed to be unique in the CiviCRM contribution table. The fix was to re-write the returned transaction ID to make it a unique value.

Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Database Error Code: Duplicate entry '0-1' for key 2, 1062

This forum was archived on 2017-11-26.