Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Foreign Key Constraint #104

Open
ddoligalski opened this issue Aug 11, 2016 · 0 comments
Open

Foreign Key Constraint #104

ddoligalski opened this issue Aug 11, 2016 · 0 comments
Assignees

Comments

@ddoligalski
Copy link

(Version 2.1.beta as well as 2.0)

I am running into database foreign key constraints on inserts to civicrm_mandrill_activity. This is occurring when trying to send an email to a contact (Action => Send Email) and it looks like it might be happening elsewhere.

From all appearances, the column mailing_queue_id is not being passed in the insert into civicrm_mandrill_activity causing the foreign key constraint to fail.

The relevant backtrace is:

#0 /var/www/sites/all/modules/civicrm/CRM/Core/Error.php(911): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::nullHandler(Object(DB_Error))
#2 /var/www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /var/www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) [nativ...")
#4 /var/www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) [nativ...")
#5 /var/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) [nativ...", "DB_Error", TRUE)
#6 /var/www/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "1364 ** Field 'mailing_queue_id' doesn't have a default value")
#7 /var/www/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /var/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) ")
#9 /var/www/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) ")
#10 /var/www/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_mandrill_activity (activity_id ) VALUES ( 55914 ) ")
#11 /var/www/sites/all/modules/civicrm/CRM/Core/DAO.php(442): DB_DataObject->insert()
#12 /var/www/sites/default/files/civicrm_extensions/biz.jmaconsulting.mte/CRM/Mte/BAO/MandrillActivity.php(50): CRM_Core_DAO->save()
#13 /var/www/sites/default/files/civicrm_extensions/biz.jmaconsulting.mte/mte.php(560): CRM_Mte_BAO_MandrillActivity::create((Array:2))
#14 /var/www/sites/all/modules/civicrm/CRM/Utils/Hook.php(203): mte_civicrm_postEmailSend((Array:3))
#15 /var/www/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(87): CRM_Utils_Hook->runHooks((Array:50), "civicrm_postEmailSend", 1, (Array:3), NULL, NULL, NULL, NULL, NULL)
#16 /var/www/sites/all/modules/civicrm/CRM/Utils/Hook.php(1533): CRM_Utils_Hook_DrupalBase->invoke(1, (Array:3), NULL, NULL, NULL, NULL, NULL, "civicrm_postEmailSend")
#17 /var/www/sites/all/modules/civicrm/CRM/Utils/Mail.php(188): CRM_Utils_Hook::postEmailSend((Array:3))
#18 /var/www/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php(1645): CRM_Utils_Mail::send((Array:3))
#19 /var/www/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php(1359): CRM_Activity_BAO_Activity::sendMessage("\"TestAccount\" <[email protected]> ", "111832", "116262", "Test 2", "", "<p>Did this email from via Mandrill?</p>\r\n", "[email protected]", 55913, (Array:0), "", "")
#20 /var/www/sites/all/modules/civicrm/CRM/Contact/Form/Task/EmailCommon.php(477): CRM_Activity_BAO_Activity::sendEmail((Array:1), "Test 2", "", "<p>Did this email from via Mandrill?</p>\r\n", NULL, NULL, "\"TestAccount\" <[email protected]> ", (Array:0), "", "", (Array:1), NULL)
#21 /var/www/sites/all/modules/civicrm/CRM/Contact/Form/Task/Email.php(171): CRM_Contact_Form_Task_EmailCommon::postProcess(Object(CRM_Contact_Form_Task_Email))
#22 /var/www/sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM_Contact_Form_Task_Email->postProcess()
#23 /var/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(166): CRM_Core_Form->mainProcess()
#24 /var/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(133): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contact_Form_Task_Email), "upload")
#25 /var/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contact_Form_Task_Email), "upload")
#26 /var/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Task_Email), "upload")
#27 /var/www/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("upload")
#28 /var/www/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(115): CRM_Core_Controller->run()
#29 /var/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Task_Email", "Activities", (Array:1))
#30 /var/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#31 /var/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:4))
#32 /var/www/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:4))
#33 [internal function](): civicrm_invoke("activity", "email", "add")
#34 /var/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
#35 /var/www/index.php(21): menu_execute_active_handler()
#36 {main}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants