0

After upgrading from 4.7.18 to 4.7.22 (maybe it has nothing to do with that) -

I check out and pay via Paypal in an online registration page, I get redirected to the Thank You page, where I can review my info and click Confirm. After clicking confirm, I get an error saying:

DB Error: no such field

Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/tamera/www/www/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107

The new registration is not listed then in Civi, the participant is not registered, nor the payment that he did, although the payment was already done (which creates a lot of problems with refunds and explanations).

And in the logs I can see these 3 messages in that moment:

Notice: Undefined index: feeamt in CRM_Core_Payment_PayPalImpl->doExpressCheckout() (line 333 of /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Payment/PayPalImpl.php).

$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -19 [message] => DB Error: no such field [mode] => 16 [debug_info] => INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , check_number ) VALUES ( 12 , 20170812110912 , 240 , 0 , 240 , 'EUR' , 1 , '9YB45647LC580693G' , 1 , 4 , 1 , NULL ) [nativecode=1054 ** Unknown column 'card_type_id' in 'field list'] [type] => DB_Error [user_info] => INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , check_number ) VALUES ( 12 , 20170812110912 , 240 , 0 , 240 , 'EUR' , 1 , '9YB45647LC580693G' , 1 , 4 , 1 , NULL ) [nativecode=1054 ** Unknown column 'card_type_id' in 'field list'] [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , check_number ) VALUES ( 12 , 20170812110912 , 240 , 0 , 240 , 'EUR' , 1 , '9YB45647LC580693G' , 1 , 4 , 1 , NULL ) [nativecode=1054 ** Unknown column 'card_type_id' in 'field list']"] )

$backTrace = 
#0 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(229): CRM_Core_Error::backtrace("backTrace", TRUE) 
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error)) 
#2 /home/tamera/www/www/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error)) 
#3 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...") 
#4 /home/tamera/www/www/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...") 
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, NULL, NULL, "INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...", "DB_Error", TRUE) 
#6 /home/tamera/www/www/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8)) 
#7 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7)) 
#8 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...", "DB_Error", TRUE) 
#9 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'card_type_id' in 'field list'") 
#10 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError() 
#11 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...")         
#12 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...") 
#13 /home/tamera/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php(1068): DB_DataObject->_query("INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , tot...") 
#14 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(495): DB_DataObject->insert() 
#15 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/BAO/FinancialTrxn.php(66): CRM_Core_DAO->save() 
#16 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(3451): CRM_Core_BAO_FinancialTrxn::create((Array:15)) 
#17 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(234): CRM_Contribute_BAO_Contribution::recordFinancialAccounts((Array:28)) 
#18 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(1043): CRM_Contribute_BAO_Contribution::add((Array:28), (Array:0)) 
#19 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(611): CRM_Event_Form_Registration_Confirm::processContribution(Object(CRM_Event_Form_Registration_Confirm), (Array:57), (Array:56), "122808", FALSE, FALSE, (Array:23)) 
#20 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Event_Form_Registration_Confirm->postProcess() 
#21 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess() 
#22 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Event_Form_Registration_Confirm), "next", "Next") 
#23 /home/tamera/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Event_Form_Registration_Confirm), "next") 
#24 /home/tamera/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Registration_Confirm), "next") 
#25 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next") 
#26 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Core_Controller->run((Array:3), NULL) 
#27 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15)) 
#28 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3)) 
#29 /home/tamera/www/www/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3)) 
#30 [internal function](): civicrm_invoke("event", "register") 
#31 /home/tamera/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2)) 
#32 /home/tamera/www/www/index.php(21): menu_execute_active_handler() 
#33 {main}
1

This is the most important part of the error:

Unknown column 'card_type_id' in 'field list'

A feature added since 4.7.18 is the ability to store the type of credit card used during a credit card transaction. So a new field card_type_id was created to store that data.

Your copy of the database doesn't have this field.

I think the most likely explanation is that you upgraded CiviCRM's file system without visiting the page that upgrades the database. From your backtrace, I can see you're running Drupal; please try visiting http://<your_drupal_home>/civicrm/upgrade?reset=1 (reference: Drupal upgrade instructions step 11).

The second possibility is that there's a bug in the upgrade script that prevented this field from being added - but this is the first I've heard of someone having this problem. Please try to run the upgrade script again and see if it resolves your issue.

  • I did upgrade the database when I updated the file system, and my civicrm_financial_trxn table has the column 'card_type_id', with all null's and default value null as well. The weird thing is that the failed query doesn't even have this column in it. So I thought maybe in one of the triggers, but the only one for the insert is just inserting into the log table the old value of that column. Should not throw any exception. – Elad Aug 13 '17 at 16:42
1

OK, found it. For some reason the log table log_civicrm_financial_trxn did not have the card_type_id column, therefore the trigger that tried to log any action on the table threw an exception. Once I added the column manually to the log table, the problem was solved.

  • Ooh - that's a good catch! I feel like a very similar bug was caught at almost the same time as this – Jon G - Megaphone Tech Aug 13 '17 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.