2

Update: This is a confirmed bug, with issue filed on gitlab.


After a CiviCRM update across quite a few versions (from somewhere around 5.39 to 5.51), I've started to get failures when I try to import contribution records. The import task starts OK, but the Queue Runner gives me this error: [Error: Processed 5 rows out of 16] Invalid field 'email' (full error log below) This happens with every set of five rows, and I'm not even importing an email field. Confusingly, at the end of the import task, the notice says "Import has completed successfully... Total Rows Imported - 16 - Total number of primary records created or modified during the import." This is inaccurate, as no records are created or modified.

Aside from the fact that I played fast and loose with upgrading best practices and should be more careful in the future, what's my best approach at this point? Is there a way to check to make sure all of my database upgrades completed accurately, or a way to run the db upgrade utility again? Maybe this isn't a db problem. I have no idea where to start.

Civi 5.51.0, Joomla 3.10.6

[info] $CRM_Queue_Page_AJAX_runNext_error = API_Exception: "Invalid field 'email'"
#0 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(613): Civi\Api4\Query\Api4SelectQuery->getField("email", TRUE)
#1 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(455): Civi\Api4\Query\Api4SelectQuery->getExpression("email", (Array:2))
#2 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(425): Civi\Api4\Query\Api4SelectQuery->composeClause((Array:4), "WHERE", 0)
#3 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(298): Civi\Api4\Query\Api4SelectQuery->treeWalkClauses((Array:4), "WHERE")
#4 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(150): Civi\Api4\Query\Api4SelectQuery->buildWhereClause()
#5 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(165): Civi\Api4\Query\Api4SelectQuery->getSql()
#6 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(114): Civi\Api4\Query\Api4SelectQuery->run()
#7 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(101): Civi\Api4\Generic\DAOGetAction->getObjects(Object(Civi\Api4\Generic\Result))
#8 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(69): Civi\Api4\Generic\DAOGetAction->_run(Object(Civi\Api4\Generic\Result))
#9 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOGetAction))
#10 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(234): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#11 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Contribute/Import/Parser/Contribution.php(910): Civi\Api4\Generic\AbstractAction->execute()
#12 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Contribute/Import/Parser/Contribution.php(721): CRM_Contribute_Import_Parser_Contribution->lookupMatchingContact((Array:2))
#13 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Contribute/Import/Parser/Contribution.php(317): CRM_Contribute_Import_Parser_Contribution->deprecatedFormatParams((Array:12), (Array:21))
#14 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Import/Parser.php(1917): CRM_Contribute_Import_Parser_Contribution->import((Array:36))
#15 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/Task.php(95): CRM_Import_Parser::runJob(Object(CRM_Queue_TaskContext), 11, 5, 0)
#16 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/Runner.php(257): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#17 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner->runNext(TRUE)
#18 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/ErrorPolicy.php(89): CRM_Queue_Page_AJAX::{closure}()
#19 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy->call(Object(Closure))
#20 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(285): CRM_Queue_Page_AJAX::runNext()
#21 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
#22 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#23 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:4))
#24 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke()
#25 /home/xxxxxx/www/www/libraries/src/Component/ComponentHelper.php(402): require_once("/home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php")
#26 /home/xxxxxx/www/www/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent("/home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php")
#27 /home/xxxxxx/www/www/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
#28 /home/xxxxxx/www/www/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch()
#29 /home/xxxxxx/www/www/libraries/src/Application/CMSApplication.php(225): Joomla\CMS\Application\AdministratorApplication->doExecute()
#30 /home/xxxxxx/www/www/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute()
#31 {main}
5
  • There were a couple import issues in 5.51.0 since import was revamped in that version. If you can upgrade to the latest 5.51 or 5.52 it's probably fixed.
    – Demerit
    Aug 15, 2022 at 17:19
  • Try the latest version first. If that doesn't fix it - I note that your backtrace includes 'lookupMatchingContact'. Are your dedupe rules using email? Is so, try a different dedupe rule using fields in your import.
    – Aidan
    Aug 22, 2022 at 12:09
  • Updated to 5.52, and that at least helped with the confusing error message. The import now completes, but every row is skipped. The error report shows <Invalid field 'email'>. I tried Aidan's suggestion to change the Unsupervised Dedupe rule to one that didn't include the email field. No change. The import includes ContactID, so no other matching fields should be necessary. And is (should) a contact dedupe rule (be) triggered when importing Contributions? Aug 22, 2022 at 18:40
  • 1
    We're on 5.52.3 and getting the same error. We've found that the import succeeds if we don't include the soft credit, and fails on every row if we include it, so it looks like it's something to do with matching the soft credit contact. We're identifying the soft credit by external ID. Sep 2, 2022 at 4:28
  • @PatrickLesslie, thank you for that tip! Removing soft credit fields from the import fixes this problem. Seems like a bug to me. Have you (or anyone else) reported this at lab.civicrm.org? (Add your comment as an answer and I'll mark it as correct.) Sep 8, 2022 at 16:06

1 Answer 1

1

5.54 is out now - can you check against it? There have been relevant code changes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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