Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Fatal error and notices on DEV branch when IPN is called #101

Closed
tapashdatta opened this issue Jan 6, 2021 · 4 comments
Closed

Fatal error and notices on DEV branch when IPN is called #101

tapashdatta opened this issue Jan 6, 2021 · 4 comments

Comments

@tapashdatta
Copy link

tapashdatta commented Jan 6, 2021

On Civi 5.32.2
I am seeing following errors when updated the contribution via webhook @artfulrobot

$Fatal Error Details = Array (
 [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler )
 [code] => -5
 [message] => DB Error: already exists
 [mode] => 16
 [debug_info] => INSERT INTO `civicrm_activity_contact`
   (`activity_id` , `contact_id` , `record_type_id` ) VALUES ( 63551 , 8949 , 2 )
 [nativecode=1062 ** Duplicate entry '8949-63551-2' for key 'UI_activity_contact']
 [type] => DB_Error
 [user_info] => INSERT INTO `civicrm_activity_contact`
   (`activity_id` , `contact_id` , `record_type_id` ) VALUES ( 63551 , 8949 , 2 )
 [nativecode=1062 ** Duplicate entry '8949-63551-2' for key 'UI_activity_contact']
 [to_string] =>
 [db_error:
   message="DB Error: already exists" code=-5 mode=callback
   callback=CRM_Core_Error::exceptionHandler
   prefix=""
   info="INSERT INTO `civicrm_activity_contact`
    (`activity_id` , `contact_id` , `record_type_id` ) VALUES ( 63551 , 8949 , 2 )
  [nativecode=1062 ** Duplicate entry '8949-63551-2' for key 'UI_activity_contact']"] )
backTrace =
#0 sites/all/modules/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...")
#3 sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-5, 16, (Array:2), "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...")
#4 sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...", "DB_Error", TRUE)
#5 sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-5, NULL, NULL, "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...", "1062 ** Duplicate entry '8949-63551-2' for key 'UI_activity_contact'")
#7 sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...")
#9 sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...")
#10 sites/all/modules/civicrm/packages/DB/DataObject.php(1245): DB_DataObject->_query("INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `recor...")
#11 sites/all/modules/civicrm/CRM/Core/DAO.php(639): DB_DataObject->insert()
#12 sites/all/modules/civicrm/CRM/Activity/BAO/ActivityContact.php(44): CRM_Core_DAO->save()
#13 sites/all/modules/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php(140): CRM_Activity_BAO_ActivityContact::create((Array:4))
#14 sites/all/modules/civicrm/Civi/Api4/Generic/DAOSaveAction.php(41): Civi\Api4\Generic\DAOSaveAction->writeObjects((Array:1))
#15 sites/all/modules/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Generic\DAOSaveAction->_run(Object(Civi\Api4\Generic\Result))
#16 sites/all/modules/civicrm/Civi/API/Kernel.php(150): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOSaveAction))
#17 sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(238): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOSaveAction))
#18 sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php(411): Civi\Api4\Generic\AbstractAction->execute()
#19 sites/all/modules/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php(140): CRM_Activity_BAO_Activity::create((Array:11))
#20 sites/all/modules/civicrm/Civi/Api4/Generic/DAOSaveAction.php(41): Civi\Api4\Generic\DAOSaveAction->writeObjects((Array:1))
#21 sites/all/modules/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Generic\DAOSaveAction->_run(Object(Civi\Api4\Generic\Result))
#22 sites/all/modules/civicrm/Civi/API/Kernel.php(150): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOSaveAction))
#23 sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(238): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOSaveAction))
#24 sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(522): Civi\Api4\Generic\AbstractAction->execute()
#25 sites/all/modules/civicrm/api/v3/utils.php(1297): CRM_Contribute_BAO_Contribution::create((Array:14), (Array:1))
#26 sites/all/modules/civicrm/api/v3/Contribution.php(77): _civicrm_api3_basic_create("CRM_Contribute_BAO_Contribution", (Array:14), "Contribution")
#27 sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_contribution_create((Array:14))
#28 sites/all/modules/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#29 sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#30 sites/all/modules/civicrm/api/api.php(131): Civi\API\Kernel->runSafe("Contribution", "create", (Array:4))
#31 sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.gocardless/CRM/Core/Payment/GoCardlessIPN.php(302): civicrm_api3("Contribution", "create", (Array:4))
#32 sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.gocardless/CRM/Core/Payment/GoCardlessIPN.php(196): CRM_Core_Payment_GoCardlessIPN->doPaymentsConfirmed(Object(stdClass))
#33 sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.gocardless/CRM/Core/Payment/GoCardlessIPN.php(91): CRM_Core_Payment_GoCardlessIPN->processWebhookEvents()
#34 sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.gocardless/CRM/Core/Payment/GoCardlessIPN.php(48): CRM_Core_Payment_GoCardlessIPN->handleRequest()
#35 sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.gocardless/CRM/Core/Payment/GoCardless.php(348): CRM_Core_Payment_GoCardlessIPN::run(Object(CRM_Core_Payment_GoCardless))
#36 sites/all/modules/civicrm/CRM/Core/Payment.php(1610): CRM_Core_Payment_GoCardless->handlePaymentNotification()
#37 sites/all/modules/civicrm/CRM/Core/Payment.php(1503): CRM_Core_Payment::handlePaymentMethod("handlePaymentNotification", (Array:3))
#38 sites/all/modules/civicrm/CRM/Core/Invoke.php(278): CRM_Core_Payment::handleIPN()
#39 sites/all/modules/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:14))
#40 sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#41 sites/all/modules/civicrm/drupal/civicrm.module(459): CRM_Core_Invoke::invoke((Array:4))
#42 includes/menu.inc(527): civicrm_invoke("payment", "ipn", "5")
#43 index.php(21): menu_execute_active_handler()
#44 {main}


Notice: Undefined index: 35 in CRM_Financial_BAO_PaymentProcessor::getPayment()
(line 232 of /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php).

Notice: Undefined variable: CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromContributionPage
in CRM_Contribute_BAO_Contribution->loadRelatedObjects()(line 2852 of /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).

Using dev branch at affdac4

@artfulrobot
Copy link
Owner

@tapashdatta thanks. I've not tested it on 5.32 yet. will take a look.

@artfulrobot
Copy link
Owner

@tapashdatta Does this still happen/happen every time?

@artfulrobot
Copy link
Owner

I experienced this too. I made this to fix it:

f6fdbbe

@tapashdatta
Copy link
Author

Works now. Thanks

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

No branches or pull requests

2 participants