0

I've been getting a persistent guzzle error since Civi version 5.5x, and I now realise there's also some weird permission error and am wondering if this is related.

I'm on the latest versions of WordPress and CiviCRM, running PHP8.1 (though I only just upgraded PHP, hoping it would fix this - these errors appeared on PHP7.4). All extensions are up to date.

The Guzzle error appears in the system status console:

Guzzle client error: Could not load a clean page to check

I have checked previous questions about guzzle. I upgraded to composer version 2 and ran composer require guzzlehttp/guzzle:'^7' but this has not resolved the problem.

I also noticed today an issue that may or may not be related. When I run wp theme list it throws a PHP error:

PHP Warning:  file_put_contents(/var/www/html/wp-content/uploads/civicrm/templates_c/CachedExtLoader.b16e0079d1aac6538c9e131b852f3532.php): Failed to open stream: Permission denied in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php on line 87
Warning: file_put_contents(/var/www/html/wp-content/uploads/civicrm/templates_c/CachedExtLoader.b16e0079d1aac6538c9e131b852f3532.php): Failed to open stream: Permission denied in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php on line 87
PHP Fatal error:  Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/CachedCiviContainer.b16e0079d1aac6538c9e131b852f3532.phpa71jfv" to "/var/www/html/wp-content/uploads/civicrm/templates_c/CachedCiviContainer.b16e0079d1aac6538c9e131b852f3532.php". in /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php:290
Stack trace:
#0 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php(696): Symfony\Component\Filesystem\Filesystem->rename()
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/config/ResourceCheckerConfigCache.php(124): Symfony\Component\Filesystem\Filesystem->dumpFile()
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(84): Symfony\Component\Config\ResourceCheckerConfigCache->write()
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(684): Civi\Core\Container->loadContainer()
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(87): Civi\Core\Container::boot()
#5 /var/www/html/wp-content/plugins/civicrm/includes/civicrm.admin.php(434): CRM_Core_Config::singleton()
#6 /var/www/html/wp-content/plugins/civicrm/civicrm.php(972): CiviCRM_For_WordPress_Admin->initialize()
#7 /var/www/html/wp-content/plugins/civicrm/civicrm.php(794): CiviCRM_For_WordPress->initialize()
#8 /var/www/html/wp-content/plugins/civicrm/civicrm.php(767): CiviCRM_For_WordPress->register_hooks_clean_urls()
#9 /var/www/html/wp-content/plugins/civicrm/civicrm.php(651): CiviCRM_For_WordPress->register_hooks_common()
#10 /var/www/html/wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress->register_hooks()
#11 /var/www/html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#12 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /var/www/html/wp-settings.php(632): do_action()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1349): require('...')
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1267): WP_CLI\Runner->load_wordpress()
#16 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#17 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
#18 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#19 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
#20 /usr/local/bin/wp(4): include('...')
#21 {main}
  thrown in /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php on line 290
Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/CachedCiviContainer.b16e0079d1aac6538c9e131b852f3532.phpa71jfv" to "/var/www/html/wp-content/uploads/civicrm/templates_c/CachedCiviContainer.b16e0079d1aac6538c9e131b852f3532.php". in /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php:290
Stack trace:
#0 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php(696): Symfony\Component\Filesystem\Filesystem->rename()
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/config/ResourceCheckerConfigCache.php(124): Symfony\Component\Filesystem\Filesystem->dumpFile()
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(84): Symfony\Component\Config\ResourceCheckerConfigCache->write()
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Container.php(684): Civi\Core\Container->loadContainer()
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(87): Civi\Core\Container::boot()
#5 /var/www/html/wp-content/plugins/civicrm/includes/civicrm.admin.php(434): CRM_Core_Config::singleton()
#6 /var/www/html/wp-content/plugins/civicrm/civicrm.php(972): CiviCRM_For_WordPress_Admin->initialize()
#7 /var/www/html/wp-content/plugins/civicrm/civicrm.php(794): CiviCRM_For_WordPress->initialize()
#8 /var/www/html/wp-content/plugins/civicrm/civicrm.php(767): CiviCRM_For_WordPress->register_hooks_clean_urls()
#9 /var/www/html/wp-content/plugins/civicrm/civicrm.php(651): CiviCRM_For_WordPress->register_hooks_common()
#10 /var/www/html/wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress->register_hooks()
#11 /var/www/html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#12 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /var/www/html/wp-settings.php(632): do_action()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1349): require('...')
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1267): WP_CLI\Runner->load_wordpress()
#16 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#17 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
#18 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#19 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
#20 /usr/local/bin/wp(4): include('...')
#21 {main}
  thrown in /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/filesystem/Filesystem.php on line 290
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

This looks like a permissions error but as far as I can tell everything is correct: www-data owns everything, with rw-r--r-- on all files and rwxr-xr-x on all directories in the path.

Any help with troubleshooting this would be greatly appreciated.

2 Answers 2

1

You have a plugin or CiviCRM extension using a newer version of the Guzzle package. I had a similar issue with LMS plugin so I replaced the guzzle package in CiviCRM with a newer version.

3
  • how do I know which extension and how to replace the package? I'm not clear what guzzle even does.
    – Hugh
    Oct 7, 2023 at 23:38
  • Basically I have exactly the same thing described here: civicrm.stackexchange.com/questions/43547/… As far as I can tell the only things using guzzle are civicrm and wp-rest - I get this by running grep -r Guzzle plugins/ | cut -f 3 -d '/' | sort | uniq
    – Hugh
    Oct 8, 2023 at 0:27
  • Maybe Guzzle is in a theme? Oct 10, 2023 at 1:47
0

Same issue on recent version of CiviCRM

No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".

Looking in the ext/ folder I get this result

[root@domain]# grep -r Guzzle  | cut -f 3 -d '/' | sort | uniq
composer
geocoder-php
intervention
php-http
phpunit
psr7": "Used with Guzzle PSR-7 Factories",
Ses
Uplang
Utils
1

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.