3

with recent versions of CiviCRM (WordPress), I am getting fatal errors for all back-end/wp-admin requests, when hosting with Kinsta.com, related to an unhandled Service Not Found Exception within Civi.

I have been running CiviCRM on this client's website (WordPress) for 6+ years, and have generally updated CiviCRM every 2 months. This site has been at Kinsta for 4+ years, so this isn't anything to do with changing hosts.

Today I updated from Civi 5.54.2 to 5.57.2. It worked in my local dev (workstation) environment, and the staging environment at Kinsta. But when pulling the updates to production (via git - code is identical), I started getting fatal errors.

Working with Kinsta support, we determined the difference between staging and production was that Kinsta's internal caching system was enabled in production but not staging.

Further, in both environments, with Kinsta caching disabled, everything works. When it is enabled, we get the fatal errors.

So this clearly has something to do with the Kinsta caching system, but not entirely. When I revert to Civi 5.54.2, everything works again. (I also tried 5.56.2 and 5.55.2 but they also had errors.)

PHP error details are below.

Can anyone think of what might have changed in Civi and the Services components (and maybe "spec_gatherer" in particular) between 5.54 and 5.55 which might cause conflicts with some nginx caching scheme?

Thank you!

PHP Fatal error:  Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "spec_gatherer". in /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:1030
Stack trace:
#0 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/Civi/Core/Compiler/SpecProviderPass.php(16): Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('spec_gatherer')
#1 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/Compiler/Compiler.php(94): Civi\Core\Compiler\SpecProviderPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php(762): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#3 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(79): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#4 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(640): Civi\Core\Container->loadContainer()
#5 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(87): Civi\Core\Container::boot(true)
#6 /www/hajotuxu_393/public/wp-content/plugins/civicrm/includes/civicrm.admin.php(434): CRM_Core_Config::singleton()
#7 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm.php(972): CiviCRM_For_WordPress_Admin->initialize()
#8 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm.php(794): CiviCRM_For_WordPress->initialize()
#9 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm.php(767): CiviCRM_For_WordPress->register_hooks_clean_urls()
#10 /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm.php(651): CiviCRM_For_WordPress->register_hooks_common()
#11 /www/hajotuxu_393/public/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->register_hooks('')
#12 /www/hajotuxu_393/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#13 /www/hajotuxu_393/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /www/hajotuxu_393/public/wp-settings.php(617): do_action('init')
#15 /www/hajotuxu_393/public/wp-config.php(121): require_once('/www/hajotuxu_3...')
#16 /www/hajotuxu_393/public/wp-load.php(50): require_once('/www/hajotuxu_3...')
#17 /www/hajotuxu_393/public/wp-admin/admin.php(34): require_once('/www/hajotuxu_3...')
#18 /www/hajotuxu_393/public/wp-admin/index.php(10): require_once('/www/hajotuxu_3...')
#19 {main}
  thrown in /www/hajotuxu_393/public/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php on line 1030
2
  • I have same issue on Kinsta upgrading from 5.51 to 5.59 WP6 PHP8
    – LesleyJill
    Mar 9, 2023 at 1:35
  • This may be irrelevant but apparently something changed in 5.55 re container loading being changed to automatic from manual. Sorry cant find where I saw this and have no idea what it means anyway!
    – LesleyJill
    Mar 9, 2023 at 1:44

3 Answers 3

2

For us Kinsta hosting caching was the issue. Able to upgrade once they enabled opcache.save_comments in the Nginx server cache

1

I had the same problem. I had changed some of the php settings:

  • expose_php = off
  • magic_quotes_gpc = off
  • register_globals = off

When I commented these out everything worked. An after removing the comments it kept working.

This returned when clearing caches. So it is not solved yet.

It might be a PHP 8.1 incompatibility. Reverted to 7.4.

0

I'm also getting the error about spec_gatherer while trying to upgrade from CiviCRM 5.35.1 to 5.58.1 on a Drupal7 + PHP 7.3 environment.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "spec_gatherer". in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 1030 /var/www/XXX/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php).

Disabling expose_php, magic_quotes_gpc, register_globals had no effect.

Has anyone found a solution for this problem?

1
  • Clearing the opcode cache seems to solve the error. You can add: opcache_reset(); in your index.php file. Then refresh the page, and remove the code from index.php
    – AlainB
    Oct 6, 2023 at 12:27

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.