Troubleshooting A fatal error occurred while fetching the update Error

An error stating A fatal error occurred while fetching the update may occur in the Automatic Updater modal window inside WHMCS. It will look like this:

A fatal error occurred while fetching the update

This guide provides troubleshooting steps to identify and resolve the underlying causes of this message.

PHP Limitations

  1. Navigate to Utilities > System > PHP Info.
  2. Ensure the values set meet the minimum requirements for using the Automatic Updater.

Server-Side Limitations

Specific to the web server you are using, there are limitations that  can be imposed by the web server that cause the Automatic Updater to be terminated before it's completed, resulting in the error above.

Some of the most common configurations that may cause this include:

  • Apache TimeOut directive.
  • LiteSpeed Connection Timeout.
  • Nginx proxy_read_timeout.
  • CloudLinux IO and IOPS limits.

Observing the server response with Network Analyser

Your browser's network analyser developer tool can be used to observe the raw response from the server response (in addition to your own server logs):

  1. Follow these steps to enable your browser's network analyser tool.
  2. Return to Utilities > Update WHMCS.
  3. Click Begin Update and follow the on-screen instructions to begin the update process.
  4. In the network analyser, select the update.php entry.
  5. Select the Response tab.

The network analyzer will now display the raw response from your server. This may confirm a PHP error or server timeout message.

Work with your server administrator or hosting provider to increase the relevant timeout. Then, attempt to use the Automatic Updater again.

Testing the length of execution for a PHP script

To check and confirm that PHP scripts can run until the WHMCS defined  max_execution_time of 300 seconds:

1. Download this  test_execution_time.php script:

2. Upload it to your WHMCS directory.

3. Make a cURL request to that file. For example:

curl https://example.com/test_execution_time.php
Click to copy

4. A successful test will, after 280 seconds (the defined value in the test script), yield a response similar to this:

shutdown function called after 281.08206486702 seconds.
Click to copy

Any other response indicates the script was terminated before 280 seconds:

  • Internal Server Error A general failure. Review the server error logs.
  • No response likely indicates a PHP fatal error has occurred, like a lower  max_execution_time value exceeded by the script.
  • Another HTTP error status code (504 for example).

It is necessary to work with your server administrator or hosting provider to determine why the test_execution_time.php script is being terminated before 280 seconds and correct it.

Once the test_execution_time.php script can run for  280 seconds, attempt to use the Automatic Updater again.

Applying the update via Command Line

Where it is not possible for the aforementioned limiting factors to be removed, applying the update via the Server Command Line will typically avoid timeout issues.

Follow all the steps in Updating WHMCS at the command line to complete the update process.