Answers.Body: <p>Just having a quick glance but it looks like you might have a log record (in table log_civicrm_entity_tag)for a contact that you deleted based on this:</p>
  
  <pre><code>#6 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common-&gt;raiseError(-1, NULL, NULL, NULL, "1034 ** Incorrect key file for table 'log_civicrm_entity_tag'; try to repair it")
  </code></pre>
  
  <p>I think there is a tag linked to a contact that no longer exists in your log file?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-03T23:23:16.593Z
Answers.Text: It indeed logging-related. I turned off logging, retried a few merges, and they succeeded. Now I just have to decide how much I actually need logging.
Answers.UserDisplayName: Eric H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-04T07:51:27.993Z
Answers.Text: Cool! Glad I did spot the right track in a blink for a change :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-03T18:46:31.447Z
Answers.LastActivityDate: 2016-02-03T18:46:31.447Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm getting an error when trying to merge any two records. This seems to have started after I deleted a large number of records. Here's the error message the user gets: </p>
  
  <p>Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107</p>
  
  <p>I did a backtrace but I don't really know how to read it to glean any useful information. I'm hoping that someone with experience reading these things can enlighten me.</p>
  
  <p>#0 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()</p>
  
  <p>#1 internal function: CRM_Core_Error::handle(Object(DB_Error))</p>
  
  <p>#2 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))</p>
  
  <p>#3 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495...")</p>
  
  <p>#4 /home/websitename/public_html/wcc/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495...")</p>
  
  <p>#5 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495...", "DB_Error", TRUE)</p>
  
  <p>#6 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "1034 ** Incorrect key file for table 'log_civicrm_entity_tag'; try to repair it")</p>
  
  <p>#7 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()</p>
  
  <p>#8 /home/websitename/public_html/wcc/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495")</p>
  
  <p>#9 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495")</p>
  
  <p>#10 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495")</p>
  
  <p>#11 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495")</p>
  
  <p>#12 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/DAO.php(1192): CRM_Core_DAO->query("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495", TRUE)</p>
  
  <p>#13 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(507): CRM_Core_DAO::executeQuery("UPDATE IGNORE civicrm_entity_tag SET entity_id = 9769 WHERE entity_id = 89495", (Array:0), TRUE, NULL, TRUE)</p>
  
  <p>#14 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(1344): CRM_Dedupe_Merger::moveContactBelongings("9769", "89495", (Array:3), (Array:0))</p>
  
  <p>#15 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Contact/Form/Merge.php(330): CRM_Dedupe_Merger::moveAllBelongings("9769", "89495", (Array:26))</p>
  
  <p>#16 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM_Contact_Form_Merge->postProcess()</p>
  
  <p>#17 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()</p>
  
  <p>#18 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contact_Form_Merge), "next", "Next")</p>
  
  <p>#19 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Form_Merge), "next")</p>
  
  <p>#20 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Merge), "next")</p>
  
  <p>#21 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next")</p>
  
  <p>#22 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(115): CRM_Core_Controller->run()</p>
  
  <p>#23 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Merge", "Merge Contact", NULL)</p>
  
  <p>#24 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))</p>
  
  <p>#25 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))</p>
  
  <p>#26 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))</p>
  
  <p>#27 internal function: civicrm_invoke("contact", "merge")</p>
  
  <p>#28 /home/websitename/public_html/subdomainname/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))</p>
  
  <p>#29 /home/websitename/public_html/subdomainname/index.php(21): menu_execute_active_handler()</p>
  
  <p>#30 {main}</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-03T16:37:51.027Z
Comments.Text: What version are you on? Any extensions active? I was running into a similar error on merges and didn't have much trouble identifying the issue -- but upgraded to 4.7 to take advantage of the merge improvements, and at this point things are working much better on that front.
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-03T23:07:00.040Z
Comments.Text: I'm on 4.6.9. No extensions. That's a good note on upgrading to 4.7, thanks.
Comments.UserDisplayName: Eric H
Tags: <duplicate-contacts>
Title: Error when merging records
ThreadText: # Error when merging records
  
  (Asked by: username_0 on 2016-02-03)
  
  I'm getting an error when trying to merge any two records. This seems to have started after I deleted a large number of records. Here's the error message the user gets:
  
  Fatal error: Uncaught CRM\_Core\_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107
  
  I did a backtrace but I don't really know how to read it to glean any useful information. I'm hoping that someone with experience reading these things can enlighten me.
  
  #0 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM\_Core\_Error::backtrace()
  
  #1 internal function: CRM\_Core\_Error::handle(Object(DB\_Error))
  
  #2 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/PEAR.php(931): call\_user\_func((Array:2), Object(DB\_Error))
  
  #3 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB.php(976): PEAR\_Error->PEAR\_Error("DB Error: unknown error", -1, 16, (Array:2), "UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495...")
  
  #4 /home/websitename/public\_html/wcc/sites/all/modules/civicrm/packages/PEAR.php(564): DB\_Error->DB\_Error(-1, 16, (Array:2), "UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495...")
  
  #5 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495...", "DB\_Error", TRUE)
  
  #6 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB\_common->raiseError(-1, NULL, NULL, NULL, "1034 \*\* Incorrect key file for table 'log\_civicrm\_entity\_tag'; try to repair it")
  
  #7 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB\_mysql->mysqlRaiseError()
  
  #8 /home/websitename/public\_html/wcc/sites/all/modules/civicrm/packages/DB/common.php(1216): DB\_mysql->simpleQuery("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495")
  
  #9 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB\_common->query("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495")
  
  #10 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB\_DataObject->\_query("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495")
  
  #11 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB\_DataObject->query("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495")
  
  #12 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/DAO.php(1192): CRM\_Core\_DAO->query("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495", TRUE)
  
  #13 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(507): CRM\_Core\_DAO::executeQuery("UPDATE IGNORE civicrm\_entity\_tag SET entity\_id = 9769 WHERE entity\_id = 89495", (Array:0), TRUE, NULL, TRUE)
  
  #14 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(1344): CRM\_Dedupe\_Merger::moveContactBelongings("9769", "89495", (Array:3), (Array:0))
  
  #15 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Contact/Form/Merge.php(330): CRM\_Dedupe\_Merger::moveAllBelongings("9769", "89495", (Array:26))
  
  #16 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM\_Contact\_Form\_Merge->postProcess()
  
  #17 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/StateMachine.php(164): CRM\_Core\_Form->mainProcess()
  
  #18 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM\_Core\_StateMachine->perform(Object(CRM\_Contact\_Form\_Merge), "next", "Next")
  
  #19 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM\_Core\_QuickForm\_Action\_Next->perform(Object(CRM\_Contact\_Form\_Merge), "next")
  
  #20 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML\_QuickForm\_Controller->handle(Object(CRM\_Contact\_Form\_Merge), "next")
  
  #21 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML\_QuickForm\_Page->handle("next")
  
  #22 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(115): CRM\_Core\_Controller->run()
  
  #23 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM\_Utils\_Wrapper->run("CRM\_Contact\_Form\_Merge", "Merge Contact", NULL)
  
  #24 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM\_Core\_Invoke::runItem((Array:13))
  
  #25 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM\_Core\_Invoke::\_invoke((Array:3))
  
  #26 /home/websitename/public\_html/subdomainname/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM\_Core\_Invoke::invoke((Array:3))
  
  #27 internal function: civicrm\_invoke("contact", "merge")
  
  #28 /home/websitename/public\_html/subdomainname/includes/menu.inc(519): call\_user\_func\_array("civicrm\_invoke", (Array:2))
  
  #29 /home/websitename/public\_html/subdomainname/index.php(21): menu\_execute\_active\_handler()
  
  #30 {main}
  
  **Tags:** duplicate-contacts
  
  > **Comments:**
  > **username_1**: What version are you on? Any extensions active? I was running into a similar error on merges and didn't have much trouble identifying the issue -- but upgraded to 4.7 to take advantage of the merge improvements, and at this point things are working much better on that front.  
  > **username_0**: I'm on 4.6.9. No extensions. That's a good note on upgrading to 4.7, thanks.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-02-03. Score: 1 | Accepted answer
  
  Just having a quick glance but it looks like you might have a log record (in table log_civicrm_entity_tag)for a contact that you deleted based on this:
  #6 /home/websitename/public_html/subdomainname/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "1034 ** Incorrect key file for table 'log_civicrm_entity_tag'; try to repair it")
  
  I think there is a tag linked to a contact that no longer exists in your log file?
  
  > **Comments:**
  > **username_0**: It indeed logging-related. I turned off logging, retried a few merges, and they succeeded. Now I just have to decide how much I actually need logging.  
  > **username_2**: Cool! Glad I did spot the right track in a blink for a change :-)  
  
  ---
  
  