Answers.Body: <p>5.54 is out now - can you check against it? There have been relevant code changes</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-11T06:12:45.347Z
Answers.LastActivityDate: 2022-10-11T06:12:45.347Z
Answers.UserDisplayName: eileen
Body: <p>Update: This is a confirmed bug, with <a href="https://lab.civicrm.org/dev/core/-/issues/3879" rel="nofollow noreferrer">issue filed on gitlab</a>.</p>
  <hr />
  <p>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: <code>[Error: Processed 5 rows out of 16] Invalid field 'email'</code> (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 &quot;Import has completed successfully... Total Rows Imported - 16 - Total number of primary records created or modified during the import.&quot; This is inaccurate, as no records are created or modified.</p>
  <p>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.</p>
  <p>Civi 5.51.0, Joomla 3.10.6</p>
  <pre><code>[info] $CRM_Queue_Page_AJAX_runNext_error = API_Exception: &quot;Invalid field 'email'&quot;
  #0 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(613): Civi\Api4\Query\Api4SelectQuery-&gt;getField(&quot;email&quot;, TRUE)
  #1 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(455): Civi\Api4\Query\Api4SelectQuery-&gt;getExpression(&quot;email&quot;, (Array:2))
  #2 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(425): Civi\Api4\Query\Api4SelectQuery-&gt;composeClause((Array:4), &quot;WHERE&quot;, 0)
  #3 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(298): Civi\Api4\Query\Api4SelectQuery-&gt;treeWalkClauses((Array:4), &quot;WHERE&quot;)
  #4 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(150): Civi\Api4\Query\Api4SelectQuery-&gt;buildWhereClause()
  #5 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(165): Civi\Api4\Query\Api4SelectQuery-&gt;getSql()
  #6 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(114): Civi\Api4\Query\Api4SelectQuery-&gt;run()
  #7 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(101): Civi\Api4\Generic\DAOGetAction-&gt;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-&gt;_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-&gt;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-&gt;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-&gt;execute()
  #12 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Contribute/Import/Parser/Contribution.php(721): CRM_Contribute_Import_Parser_Contribution-&gt;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-&gt;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-&gt;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-&gt;run(Object(CRM_Queue_TaskContext))
  #17 /home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner-&gt;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-&gt;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(&quot;/home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php&quot;)
  #26 /home/xxxxxx/www/www/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent(&quot;/home/xxxxxx/www/www/administrator/components/com_civicrm/civicrm.php&quot;)
  #27 /home/xxxxxx/www/www/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent(&quot;com_civicrm&quot;)
  #28 /home/xxxxxx/www/www/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication-&gt;dispatch()
  #29 /home/xxxxxx/www/www/libraries/src/Application/CMSApplication.php(225): Joomla\CMS\Application\AdministratorApplication-&gt;doExecute()
  #30 /home/xxxxxx/www/www/administrator/index.php(51): Joomla\CMS\Application\CMSApplication-&gt;execute()
  #31 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-15T17:19:05.153Z
Comments.Text: 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.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-22T12:09:45.677Z
Comments.Text: 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.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-22T18:40:07.050Z
Comments.Text: 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?
Comments.UserDisplayName: Phil Morice Brubaker
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-02T04:28:26.877Z
Comments.Text: 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.
Comments.UserDisplayName: Patrick Lesslie
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-08T16:06:48.420Z
Comments.Text: @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.)
Comments.UserDisplayName: Phil Morice Brubaker
Tags: <error><import>
Title: Contribution import fails with <Invalid field 'email'> error
ThreadText: # Contribution import fails with <Invalid field 'email'> error
  
  (Asked by: username_0 on 2022-08-15)
  
  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}
  
  **Tags:** error, import
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_2**: 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.  
  > **username_0**: 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 username_2'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?  
  > **username_3**: 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.  
  > **username_0**: @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.)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2022-10-11. Score: 1
  
  5.54 is out now - can you check against it? There have been relevant code changes
  
  
  ---
  
  