Symptoms
You might receive email notifications containing entries similar to the following.
2. Website "/home/username/public_html" (https://domain.tld): Failed to reset cache for the instance #1
2. Website "/home/username/public_html" (https://domain.tld): Failed to reset cache for the instance #1: line 0: cd: /home/username/public_html": No such file or directory
2. Website "/home/username/public_html" (https://domain.tld): Failed to reset cache for the instance #1: Error: WP-CLI requires PHP 5.6.0 or newer. You are running version 5.5.38.
2. Website "/home/username/public_html" (https://domain.tld): Failed to reset cache for the instance#2: An error has occurred when decoding JSON: Decoding failed: Syntax error
Description
The error message suggests that the cache reset command (wp-toolkit --clear-cache) is failing for some instances. The issue is usually caused by PHP memory_limit value, but can also be caused when the site installation is missing or uses a PHP version before 5.6.38.
Workaround
memory_limit value
The memory_limit value for the relevant PHP installations will have to be increased. You can refer to the following article for information on changing the memory_limit value.
How to set or increase PHP INI memory_limit or other values?
Missing site installation
The site will have to be restored from a backup or removed from WP Toolkit. You can refer to the following article for information on removing the site from WP Toolkit.
How To Remove A WordPress Website Managed Via The WP Toolkit From The Command Line
PHP version before 5.6.38
The site's PHP version will have to be changed to PHP version 5.6.38 or higher. You can refer to the following article for information on how to change a site's PHP version.
How to change PHP version for a domain
Please note, PHP versions before 7.4 are considered End of Life and are no longer receiving security patches. We strongly recommend that you use a version that is still supported upstream. The list of supported PHP versions can be found in the following article.
What versions of PHP does cPanel support?
Other causes:
In case none of the above cases applies to the issue then you should check /usr/local/cpanel/3rdparty/wp-toolkit/var/logs/main-date.log for more information on what might be generating the error.