Fatal error with v3 but v2.52 works fine
I was having issues with getting SK mgd files to load on a site and tried to use the "Cleanup Caches" option from Civi admin. When doing so, I was getting a site error. Upon looking at the logs, I only seem to have a log in WP logs and nothing in Civi logs.
PHP Fatal error: Uncaught TypeError: CRM_Core_BAO_Managed::isApi4ManagedType(): Argument #1 ($entityName) must be of type string, null given, called in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php on line 64 and defined in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php:80
Stack trace:
#0 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php(64): CRM_Core_BAO_Managed::isApi4ManagedType(NULL)
#1 /home/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): CRM_Core_BAO_Managed::on_hook_civicrm_post(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...', Object(Civi\Core\UnoptimizedEventDispatcher))
#2 /home/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#3 /home/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...')
#4 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(371): Civi\Core\CiviEventDispatcher->dispatch('hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#5 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(970): CRM_Utils_Hook::post('edit', NULL, 29, Object(CRM_Civirules_BAO_CiviRulesAction), Array)
#6 /home/www/wp-content/plugins/civicrm/civicrm/api/v3/utils.php(1294): CRM_Core_DAO::writeRecord(Array)
#7 /home/www/wp-content/uploads/civicrm/ext/org.civicoop.civirules/api/v3/CiviRuleAction/Create.php(41): _civicrm_api3_basic_create('CRM_Civirules_B...', Array)
#8 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_civi_rule_action_create(Array)
#9 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#10 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest(Array)
#11 /home/www/wp-content/plugins/civicrm/civicrm/api/api.php(28): Civi\API\Kernel->runSafe('CiviRuleAction', 'create', Array)
#12 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(294): civicrm_api('CiviRuleAction', 'create', Array)
#13 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(176): CRM_Core_ManagedEntities->updateExistingEntity(Array)
#14 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(115): CRM_Core_ManagedEntities->reconcileEntities(Array)
#15 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(420): CRM_Core_ManagedEntities->reconcile()
#16 /home/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Action/System/Flush.php(40): CRM_Core_Invoke::rebuildMenuAndCaches(false, false)
#17 /home/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Action\System\Flush->_run(Object(Civi\Api4\Generic\Result))
#18 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\System\Flush))
#19 /home/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(256): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\System\Flush))
#20 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting/UpdateConfigBackend.php(48): Civi\Api4\Generic\AbstractAction->execute()
#21 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(625): CRM_Admin_Form_Setting_UpdateConfigBackend->postProcess()
#22 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#23 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Setting_UpdateConfigBackend), 'next', 'Next')
#24 /home/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Setting_UpdateConfigBackend), 'next')
#25 /home/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_UpdateConfigBackend), 'next')
#26 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle('next')
#27 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run()
#28 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(292): CRM_Utils_Wrapper->run('CRM_Admin_Form_...', 'Cleanup Caches ...', Array)
#29 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#30 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#31 /home/www/wp-content/plugins/civicrm/civicrm.php(1231): CRM_Core_Invoke::invoke(Array)
#32 /home/www/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke('')
#33 /home/www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#34 /home/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#35 /home/www/wp-admin/admin.php(259): do_action('toplevel_page_C...')
#36 {main}
thrown in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php on line 80
I have tried multiple things to see if something else was causing the issue. I have updated all other extensions that needed an update and even disabled an extension in which I created a custom RuleAction just to make sure I didn't have an outdated load or something of that nature. I then downgraded CiviRules back to v2.52 and this fatal error went away. I had originally thought maybe my CiviCRM version was behind. The initial error happened on CiviCRM v5.65.1. So I then tested this on a staging of the same site that was running CiviCRM v5.67.3 and had the exact same error. I finally updated the staging site to the latest release, CiviCRM v5.69.4 and the issue is still there.
When I updated CiviCRM, I had tried to re-update this extension and got the same error when doing the update, from v2.52 to v3. I see CRM_Utils_Hook::post('edit', NULL, 29, Object(CRM_Civirules_BAO_CiviRulesAction), Array)
in the log of both, but not sure what 29
is related to. I checked the civicrm_rule
table and I don't have a record with ID of 29
and the civicrm_rule_action
table does have an ID of 29
but it is just a group check and I was able to update that rule in the UI.
PHP Fatal error: Uncaught TypeError: CRM_Core_BAO_Managed::isApi4ManagedType(): Argument #1 ($entityName) must be of type string, null given, called in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php on line 64 and defined in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php:80
Stack trace:
#0 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php(64): CRM_Core_BAO_Managed::isApi4ManagedType(NULL)
#1 /home/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): CRM_Core_BAO_Managed::on_hook_civicrm_post(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...', Object(Civi\Core\UnoptimizedEventDispatcher))
#2 /home/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#3 /home/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...')
#4 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(371): Civi\Core\CiviEventDispatcher->dispatch('hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#5 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(970): CRM_Utils_Hook::post('edit', NULL, 29, Object(CRM_Civirules_BAO_CiviRulesAction), Array)
#6 /home/www/wp-content/plugins/civicrm/civicrm/api/v3/utils.php(1294): CRM_Core_DAO::writeRecord(Array)
#7 /home/www/wp-content/uploads/civicrm/ext/org.civicoop.civirules/api/v3/CiviRuleAction/Create.php(41): _civicrm_api3_basic_create('CRM_Civirules_B...', Array)
#8 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_civi_rule_action_create(Array)
#9 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#10 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest(Array)
#11 /home/www/wp-content/plugins/civicrm/civicrm/api/api.php(28): Civi\API\Kernel->runSafe('CiviRuleAction', 'create', Array)
#12 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(294): civicrm_api('CiviRuleAction', 'create', Array)
#13 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(176): CRM_Core_ManagedEntities->updateExistingEntity(Array)
#14 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(115): CRM_Core_ManagedEntities->reconcileEntities(Array)
#15 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(420): CRM_Core_ManagedEntities->reconcile()
#16 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php(231): CRM_Core_Invoke::rebuildMenuAndCaches(true)
#17 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Extension/Downloader.php(152): CRM_Extension_Manager->replace('/tmp/tmp-rd7Gf7...')
#18 /home/www/wp-content/plugins/civicrm/civicrm/api/v3/Extension.php(240): CRM_Extension_Downloader->download('org.civicoop.ci...', 'https://lab.civ...')
#19 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_extension_download(Array)
#20 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#21 /home/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest(Array)
#22 /home/www/wp-content/plugins/civicrm/civicrm/api/api.php(28): Civi\API\Kernel->runSafe('Extension', 'download', Array)
#23 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php(202): civicrm_api('Extension', 'download', Array)
#24 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(625): CRM_Admin_Form_Extensions->postProcess()
#25 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#26 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), 'next', 'Next')
#27 /home/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), 'next')
#28 /home/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), 'next')
#29 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle('next')
#30 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(364): CRM_Core_Controller->run()
#31 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(170): CRM_Core_Page_Basic->edit(2, NULL)
#32 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php(110): CRM_Core_Page_Basic->run()
#33 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(322): CRM_Admin_Page_Extensions->run(Array, NULL)
#34 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#35 /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#36 /home/www/wp-content/plugins/civicrm/civicrm.php(1231): CRM_Core_Invoke::invoke(Array)
#37 /home/www/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke('')
#38 /home/www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#39 /home/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#40 /home/www/wp-admin/admin.php(259): do_action('toplevel_page_C...')
#41 {main}
thrown in /home/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Managed.php on line 80