Answers.Body: <p>Are you getting the same error for all the membership or just for single user</p>
  
  <p>This error occurs when the confirmation button is clicked twice </p>
  
  <p>did you check the DB - it should have already created membership record and also related contribution and line_item record </p>
  
  <p>so please try to cancel the users existing membership and ask him to try again </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-26T08:35:43.990Z
Answers.LastActivityDate: 2015-08-26T08:35:43.990Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>A user has tried to sign-up for a new membership. They have tried and failed multiple times. The log shows:</p>
  
  <blockquote>
    <p>$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , participant_count , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , ***** , ***** , 6 , '*****' , 1 , <strong>* , *</strong> , 0 , 7 , 2 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-*****-*****-7-6' for key 'UI_line_item_value'] [type] => DB_Error [user_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , participant_count , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , ***** , ***** , 6 , '*****' , 1 , <strong>* , *</strong> , 0 , 7 , 2 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-*****-*****-7-6' for key 'UI_line_item_value'] [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , participant_count , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , ***** , ***** , 6 , '*****' , 1 , <strong>* , *</strong> , 0 , 7 , 2 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-*****-*****-7-6' for key 'UI_line_item_value']"] )</p>
  </blockquote>
  
  <p>I have seen a similar bug report but that was for membership renewals and was fixed for 4.5. <a href="https://issues.civicrm.org/jira/browse/CRM-14894" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-14894</a></p>
  
  <p>We are running 4.6.7 on Drupal 7.39</p>
  
  <p>Any help appreciated.</p>
  
Tags: <civimember>
Title: Membership sign-up fatal error: Duplicate entry, already exists
ThreadText: # Membership sign-up fatal error: Duplicate entry, already exists
  
  (Asked by: username_0 on 2015-08-25)
  
  A user has tried to sign-up for a new membership. They have tried and failed multiple times. The log shows:
  
  > $Fatal Error Details = Array ( [callback] => Array ( [0] => CRM\_Core\_Error [1] => handle ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug\_info] => INSERT INTO civicrm\_line\_item (entity\_table , entity\_id , contribution\_id , price\_field\_id , label , qty , unit\_price , line\_total , participant\_count , price\_field\_value\_id , financial\_type\_id ) VALUES ('civicrm\_membership' , \*\*\*\*\* , \*\*\*\*\* , 6 , '\*\*\*\*\*' , 1 , **\* , \*** , 0 , 7 , 2 ) [nativecode=1062 \*\* Duplicate entry 'civicrm\_membership-\*\*\*\*\*-\*\*\*\*\*-7-6' for key 'UI\_line\_item\_value'] [type] => DB\_Error [user\_info] => INSERT INTO civicrm\_line\_item (entity\_table , entity\_id , contribution\_id , price\_field\_id , label , qty , unit\_price , line\_total , participant\_count , price\_field\_value\_id , financial\_type\_id ) VALUES ('civicrm\_membership' , \*\*\*\*\* , \*\*\*\*\* , 6 , '\*\*\*\*\*' , 1 , **\* , \*** , 0 , 7 , 2 ) [nativecode=1062 \*\* Duplicate entry 'civicrm\_membership-\*\*\*\*\*-\*\*\*\*\*-7-6' for key 'UI\_line\_item\_value'] [to\_string] => [db\_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM\_Core\_Error::handle prefix="" info="INSERT INTO civicrm\_line\_item (entity\_table , entity\_id , contribution\_id , price\_field\_id , label , qty , unit\_price , line\_total , participant\_count , price\_field\_value\_id , financial\_type\_id ) VALUES ('civicrm\_membership' , \*\*\*\*\* , \*\*\*\*\* , 6 , '\*\*\*\*\*' , 1 , **\* , \*** , 0 , 7 , 2 ) [nativecode=1062 \*\* Duplicate entry 'civicrm\_membership-\*\*\*\*\*-\*\*\*\*\*-7-6' for key 'UI\_line\_item\_value']"] )
  
  I have seen a similar bug report but that was for membership renewals and was fixed for 4.5. <https://issues.civicrm.org/jira/browse/CRM-14894>
  
  We are running 4.6.7 on Drupal 7.39
  
  Any help appreciated.
  
  **Tags:** civimember
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-08-26. Score: 1
  
  Are you getting the same error for all the membership or just for single user
  
  This error occurs when the confirmation button is clicked twice
  
  did you check the DB - it should have already created membership record and also related contribution and line\_item record
  
  so please try to cancel the users existing membership and ask him to try again
  
  
  ---
  
  