Body: <p>I believe this error has been quietly happening for some time, but it was daylighted after an upgrade that brought the error to the status page (I love the update to the status page).</p>
  <p>When the process_membership scheduled job is run it fails with:</p>
  <pre><code>Parameters parsed (and passed to API method): 
  a:1:{s:7:&quot;version&quot;;i:3;}
  
  Full message: 
  Finished execution of Update Membership Statuses with result: Failure, Error message: DB Constraint Violation - membership_type_id should possibly be marked as mandatory for Membership,create API. If so, please raise a bug report.
  </code></pre>
  <p>There is a full dump in the CiviCRM log, but I can't really discern anything from it except that there was a DB error. Nevertheless, I include it in case there is a clue there for those more experienced than me.</p>
  <pre><code>Aug 24 09:41:15  [debug] $backTrace = #0 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE)
  #1 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: no such field&quot;, -19, 16, (Array:2), &quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #3 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-19, 16, (Array:2), &quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #4 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), &quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;, &quot;DB_Error&quot;, TRUE)
  #5 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7))
  #6 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common-&gt;raiseError(-19, NULL, NULL, &quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;, &quot;1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_1_66' in...&quot;)
  #7 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli-&gt;mysqliRaiseError()
  #8 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli-&gt;simpleQuery(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #9 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #10 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject-&gt;_query(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #11 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(472): DB_DataObject-&gt;query(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #12 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1637): CRM_Core_DAO-&gt;query(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;, TRUE)
  #13 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/SelectQuery.php(133): CRM_Core_DAO::executeQuery(&quot;SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...&quot;)
  #14 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/utils.php(1283): Civi\API\SelectQuery-&gt;run()
  #15 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Activity.php(302): _civicrm_api3_basic_get(&quot;CRM_Activity_BAO_Activity&quot;, (Array:4), FALSE, &quot;Activity&quot;, Object(CRM_Utils_SQL_Select))
  #16 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_activity_get((Array:4))
  #17 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #18 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #19 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(133): Civi\API\Kernel-&gt;runSafe(&quot;Activity&quot;, &quot;Get&quot;, (Array:4))
  #20 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(168): civicrm_api3(&quot;Activity&quot;, &quot;Get&quot;, (Array:4))
  #21 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(325): CRM_Member_BAO_Membership::add((Array:8))
  #22 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Membership.php(136): CRM_Member_BAO_Membership::create((Array:8), (Array:1))
  #23 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_membership_create((Array:8))
  #24 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #25 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #26 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(133): Civi\API\Kernel-&gt;runSafe(&quot;membership&quot;, &quot;create&quot;, (Array:6))
  #27 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(2318): civicrm_api3(&quot;membership&quot;, &quot;create&quot;, (Array:6))
  #28 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(476): CRM_Member_BAO_Membership::updateAllMembershipStatus((Array:4))
  #29 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_process_membership((Array:3))
  #30 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #31 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #32 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;job&quot;, &quot;process_membership&quot;, (Array:1))
  #33 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(131): civicrm_api(&quot;job&quot;, &quot;process_membership&quot;, (Array:1))
  #34 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(98): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob))
  #35 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Job.php(200): CRM_Core_JobManager-&gt;executeJobById(11)
  #36 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(573): CRM_Admin_Form_Job-&gt;postProcess()
  #37 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(56): CRM_Core_Form-&gt;mainProcess()
  #38 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit-&gt;perform(Object(CRM_Admin_Form_Job), &quot;submit&quot;)
  #39 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Job), &quot;submit&quot;)
  #40 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page-&gt;handle(&quot;submit&quot;)
  #41 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(334): CRM_Core_Controller-&gt;run()
  #42 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(140): CRM_Core_Page_Basic-&gt;edit(4, 11)
  #43 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(137): CRM_Core_Page_Basic-&gt;run()
  #44 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Admin_Page_Job-&gt;run((Array:3), NULL)
  #45 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:19))
  #46 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #47 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
  #48 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress-&gt;invoke(&quot;&quot;)
  #49 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook-&gt;apply_filters(&quot;&quot;, (Array:1))
  #50 /var/www/civi.waccglobal.org/wordpress/wp-includes/plugin.php(476): WP_Hook-&gt;do_action((Array:1))
  #51 /var/www/civi.waccglobal.org/wordpress/wp-admin/admin.php(259): do_action(&quot;toplevel_page_CiviCRM&quot;)
  #52 {main}
  </code></pre>
  <p>I <a href="https://civicrm.stackexchange.com/questions/40145/entity-job-action-process-membership-failing-due-to-db-error">found this</a>, but I can't find any sign that CiviVolunteer was ever installed on this site.</p>
  <p>I'm at a loss as to how to even determine what the problem is, much less fix it.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-24T15:05:38.167Z
Comments.Text: There error is `Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_1_66'` which is related to a custom field. Is it maybe disabled or used to exist and something still thinks it's there?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-24T19:27:11.393Z
Comments.Text: The field group likely to be called Reporting Doc and is ID = 10 in case you aren't familiar with tracking these down
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-24T20:06:27.500Z
Comments.Text: Thanks @Demerit I found a custom field named Resource #1 with ID 66. Not sure it's being used and could probably be deleted though it appears to be correctly constructed right now. However, it is for use with Activities, not Memberships or Contacts, so it seems strange that this would even be coming up. If deleting it is an option, do you think that might clear the error?
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-24T20:46:22.227Z
Comments.Text: It makes some sense because it's happening while it's trying to retrieve membership signup/renewal activities. It's almost certainly coming from [here](https://github.com/civicrm/civicrm-core/blob/a37b82e643ec91c3e0de1720694a3dbf1a34c0cd/Civi/API/SelectQuery.php#L233) when it tries to add foreign key fields (in this case the custom field). It might be a permission issue? Do you have some ACLs related to custom fields or activities or memberships?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-25T17:51:25.683Z
Comments.Text: I do have one ACL assigned, but it's on a field in the Activities area too, not in Membership. And it's not even on the field that is being complained about. If I have my nomenclature right the field name would be `a_to_civicrm_value_payment_appro_12.payment_appro_96` or something like that. Do you think there's any value in attempting to delete the custom field at `a_to_civicrm_value_reporting_doc_10.resource_1_66`
Comments.UserDisplayName: kapn
Tags: <civimember><scheduled-job>
Title: process_membership scheduled job error
ThreadText: # process_membership scheduled job error
  
  (Asked by: username_0 on 2022-08-24)
  
  I believe this error has been quietly happening for some time, but it was daylighted after an upgrade that brought the error to the status page (I love the update to the status page).
  
  When the process\_membership scheduled job is run it fails with:
  
  ```
  Parameters parsed (and passed to API method): 
  a:1:{s:7:"version";i:3;}
  
  Full message: 
  Finished execution of Update Membership Statuses with result: Failure, Error message: DB Constraint Violation - membership_type_id should possibly be marked as mandatory for Membership,create API. If so, please raise a bug report.
  
  ```
  
  There is a full dump in the CiviCRM log, but I can't really discern anything from it except that there was a DB error. Nevertheless, I include it in case there is a clue there for those more experienced than me.
  
  ```
  Aug 24 09:41:15  [debug] $backTrace = #0 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #3 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #4 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", "DB_Error", TRUE)
  #5 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
  #6 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-19, NULL, NULL, "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", "1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_1_66' in...")
  #7 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
  #8 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #9 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #10 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #11 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(472): DB_DataObject->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #12 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1637): CRM_Core_DAO->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", TRUE)
  #13 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/SelectQuery.php(133): CRM_Core_DAO::executeQuery("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
  #14 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/utils.php(1283): Civi\API\SelectQuery->run()
  #15 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Activity.php(302): _civicrm_api3_basic_get("CRM_Activity_BAO_Activity", (Array:4), FALSE, "Activity", Object(CRM_Utils_SQL_Select))
  #16 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_activity_get((Array:4))
  #17 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #18 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #19 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(133): Civi\API\Kernel->runSafe("Activity", "Get", (Array:4))
  #20 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(168): civicrm_api3("Activity", "Get", (Array:4))
  #21 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(325): CRM_Member_BAO_Membership::add((Array:8))
  #22 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Membership.php(136): CRM_Member_BAO_Membership::create((Array:8), (Array:1))
  #23 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_membership_create((Array:8))
  #24 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #25 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #26 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(133): Civi\API\Kernel->runSafe("membership", "create", (Array:6))
  #27 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(2318): civicrm_api3("membership", "create", (Array:6))
  #28 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(476): CRM_Member_BAO_Membership::updateAllMembershipStatus((Array:4))
  #29 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_process_membership((Array:3))
  #30 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #31 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #32 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("job", "process_membership", (Array:1))
  #33 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(131): civicrm_api("job", "process_membership", (Array:1))
  #34 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(98): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
  #35 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Job.php(200): CRM_Core_JobManager->executeJobById(11)
  #36 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(573): CRM_Admin_Form_Job->postProcess()
  #37 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(56): CRM_Core_Form->mainProcess()
  #38 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Admin_Form_Job), "submit")
  #39 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Job), "submit")
  #40 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle("submit")
  #41 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(334): CRM_Core_Controller->run()
  #42 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(140): CRM_Core_Page_Basic->edit(4, 11)
  #43 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(137): CRM_Core_Page_Basic->run()
  #44 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Admin_Page_Job->run((Array:3), NULL)
  #45 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:19))
  #46 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #47 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
  #48 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke("")
  #49 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters("", (Array:1))
  #50 /var/www/civi.waccglobal.org/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action((Array:1))
  #51 /var/www/civi.waccglobal.org/wordpress/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
  #52 {main}
  
  ```
  
  I [found this](https://civicrm.stackexchange.com/questions/40145/entity-job-action-process-membership-failing-due-to-db-error), but I can't find any sign that CiviVolunteer was ever installed on this site.
  
  I'm at a loss as to how to even determine what the problem is, much less fix it.
  
  **Tags:** civimember, scheduled-job
  
  > **Comments:**
  > **username_1**: There error is `Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_1_66'` which is related to a custom field. Is it maybe disabled or used to exist and something still thinks it's there?  
  > **username_2**: The field group likely to be called Reporting Doc and is ID = 10 in case you aren't familiar with tracking these down  
  > **username_0**: Thanks @username_1 I found a custom field named Resource #1 with ID 66. Not sure it's being used and could probably be deleted though it appears to be correctly constructed right now. However, it is for use with Activities, not Memberships or Contacts, so it seems strange that this would even be coming up. If deleting it is an option, do you think that might clear the error?  
  > **username_1**: It makes some sense because it's happening while it's trying to retrieve membership signup/renewal activities. It's almost certainly coming from [here](https://github.com/civicrm/civicrm-core/blob/a37b82e643ec91c3e0de1720694a3dbf1a34c0cd/Civi/API/SelectQuery.php#L233) when it tries to add foreign key fields (in this case the custom field). It might be a permission issue? Do you have some ACLs related to custom fields or activities or memberships?  
  > **username_0**: I do have one ACL assigned, but it's on a field in the Activities area too, not in Membership. And it's not even on the field that is being complained about. If I have my nomenclature right the field name would be `a_to_civicrm_value_payment_appro_12.payment_appro_96` or something like that. Do you think there's any value in attempting to delete the custom field at `a_to_civicrm_value_reporting_doc_10.resource_1_66`  
  
  ---
  
  ## 0 answers
  
  