1

I need help figuring out what's causing an error in CiviCRM and how to fix it. It happens when trying to install or uninstall new civi extensions (both from UI and CLI), when trying to rebuild the menus, when clearing the cache from Civi UI.

Thanks for any assistance.

Currently running:

Drupal Version 10.2.4, PHP Version 8.3.2, CiviCRM Version 5.71.2

Example 1

Call to: https://www.XXXXXXXX.org/civicrm/admin/setting/updateConfigBackend?reset=1

    $Fatal Error Details = array:3 [ "message" => " is not of type String" "code" => null "exception" => CRM_Core_Exception {#22699 #message: " is not of type String" #code: 0 #file: "/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php" #line: 1898 #cause: null -_trace: null -errorData: array:1 [ "error_code" => 0 ] trace: { 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php:1898 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php:1830 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Reference/Dynamic.php:104 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php:2681 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/Api4/Utils/CoreUtil.php:326 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php:379 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php:180 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php:115 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:421 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/Api4/Action/System/Flush.php:40 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/Api4/Provider/ActionObjectProvider.php:70 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/API/Kernel.php:156 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php:256 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Admin/Form/Setting/UpdateConfigBackend.php:48 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Form.php:641 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/StateMachine.php:144 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php:43 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php:203 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php:103 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Controller.php:355 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Utils/Wrapper.php:98 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:293 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:69 { …} 
/home/XXXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:36 { …} 
/home/XXXXXXXX/www/www/web/modules/contrib/civicrm/src/Civicrm.php:88 { Drupal\civicrm\Civicrm->invoke($args) › ob_start(); › $content = \CRM_Core_Invoke::invoke($args); › $output = ob_get_clean(); arguments: { $args: array:4 [ …4] } } 
/home/XXXXXXXX/www/www/web/modules/contrib/civicrm/src/Controller/CivicrmController.php:83 { …} Drupal\civicrm\Controller\CivicrmController->main() {} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/Render/Renderer.php:627 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:121 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97 { …}
/home/XXXXXXXX/www/www/vendor/symfony/http-kernel/HttpKernel.php:181 { …} 
/home/XXXXXXXX/www/www/vendor/symfony/http-kernel/HttpKernel.php:76 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/Session.php:58 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php:28 { …} 
/home/XXXXXXXX/www/www/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php:32 { …} 
/home/XXXXXXXX/www/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106 { …} 
/home/XXXXXXXX/www/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php:36 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51 { …} 
/home/XXXXXXXX/www/www/web/core/lib/Drupal/Core/DrupalKernel.php:704 { …} 
/home/XXXXXXXX/www/www/web/index.php:19 { …} } } ]

Example 2

CLI from SSH to uninstall civi extension no longer needed: composer exec cv ext:uninstall org.civicrm.module.cividiscount

Error: API Call Failed: Array
(
    [entity] => Extension
    [action] => disable
    [params] => Array
        (
            [keys] => Array
                (
                    [0] => org.civicrm.module.cividiscount
                )

            [debug] => 1
            [version] => 3
        )

    [result] => Array
        (
            [error_code] => 0
            [entity] => Extension
            [action] => disable
            [trace] => #0 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(1830): CRM_Core_DAO::composeQuery('SELECT count(id...', Array, true)
#1 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Reference/Dynamic.php(104): CRM_Core_DAO::singleValueQuery('SELECT count(id...', Array)
#2 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(2681): CRM_Core_Reference_Dynamic->getReferenceCount(Object(CRM_Core_DAO_OptionValue))
#3 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/Api4/Utils/CoreUtil.php(326): CRM_Core_DAO->getReferenceCounts()
#4 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php(379): Civi\Api4\Utils\CoreUtil::getRefCount('OptionValue', NULL)
#5 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php(180): CRM_Core_ManagedEntities->removeStaleEntity(Array)
#6 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/ManagedEntities.php(115): CRM_Core_ManagedEntities->reconcileEntities(Array)
#7 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(421): CRM_Core_ManagedEntities->reconcile()
#8 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/CRM/Extension/Manager.php(439): CRM_Core_Invoke::rebuildMenuAndCaches(true)
#9 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/api/v3/Extension.php(150): CRM_Extension_Manager->disable(Array)
#10 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_extension_disable(Array)
#11 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#12 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest(Array)
#13 /home/XXXXXXX/www/www/vendor/civicrm/civicrm-core/api/api.php(28): Civi\API\Kernel->runSafe('Extension', 'disable', Array)
#14 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/src/Command/BaseCommand.php(39): civicrm_api('Extension', 'disable', Array)
#15 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/src/Command/ExtensionUninstallCommand.php(44): Civi\Cv\Command\BaseCommand->callApiSuccess(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput), 'Extension', 'disable', Array)
#16 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/vendor/symfony/console/Command/Command.php(127): Civi\Cv\Command\ExtensionUninstallCommand->execute(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#17 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/vendor/symfony/console/Application.php(637): Cvphar\Symfony\Component\Console\Command\Command->run(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#18 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/vendor/symfony/console/Application.php(190): Cvphar\Symfony\Component\Console\Application->doRunCommand(Object(Civi\Cv\Command\ExtensionUninstallCommand), Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#19 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/src/Application.php(67): Cvphar\Symfony\Component\Console\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#20 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/vendor/symfony/console/Application.php(101): Civi\Cv\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#21 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/src/Application.php(33): Cvphar\Symfony\Component\Console\Application->run()
#22 phar:///home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar/bin/cv(28): Civi\Cv\Application::main('phar:///home/th...')
#23 /home/XXXXXXX/www/www/vendor/civicrm/cli-tools/extern/cv.phar(14): require('phar:///home/th...')
#24 /home/XXXXXXX/www/www/vendor/civicrm/cli-tools/bin/cv(7): require('/home/thinkfirs...')
#25 /home/XXXXXXX/www/www/vendor/bin/cv(119): include('/home/thinkfirs...')
#26 {main}
            [is_error] => 1
            [error_message] =>  is not of type String
        )

)
1
  • Encountered a similar problem on 5.72-rc when flushing (cv flush) a local dev-site. Observed with [email protected] or 7.4. Don't have cividiscount. Problem occurred while it was checking refcount for civicrm_acl where entity_id=%1... with [1=>[NULL, 'String']. (Accidentally lost the config, and having trouble reproducing again.)
    – Tim Otten
    Apr 3 at 23:27

1 Answer 1

2

In your second example, the error is arising during a 'rebuildMenuandCaches' phase of the extension disable process and is an issue when it's reconciling an option group. I'd suspect a bad extension (probably not cividiscount), which you could fix by using the database extension table to just disable them all (set the is_active field to 0), clear caches and then try re-enabling one by one.

It wouldn't surprise me if this is php-related.

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.