Troubleshooting an TypeError: Argument 1 passed to Carbon\CarbonInterval::setLocalTranslator() Error

Symptom

You may encounter the following error after updating through WHMCS v8.0:

TypeError: Argument 1 passed to Carbon\CarbonInterval::setLocalTranslator() must implement interface Symfony\Component\Translation\TranslatorInterface

Cause

One or more deprecated files exist in the WHMCS. The server configuration or file permissions or ownership prevented the update process from automatically removing these old files.

Solution

Delete the /vendor/symfony/translation/TranslatorInterface.php file from your server. WHMCS v8.0 and above do not require it, so you can safely remove it.

This will resolve the error immediately.

Followup

The update process also may not have been able to remove other deprecated files that you must manually remove. To find them, review the entries at Configuration > System Logs for the time at which you updated WHMCS.

If the server configuration or file permissions or ownership prevented the removal of old files, you will see one of the following log entries:

Permissions prevent removal of $file_name

or

Unable to remove $file_name

Remove the files and folders in these log entries from your server.