Cron Metrics Polling Timeout

Problem

The daily cron run is failing due to timeouts during Tenant Usage Metrics polling:

Timeout during Tenant Usage Metrics polling

In the Activity Log at Configuration () > System Logs, you see some cron job entries, but none after Cron Job: Running Usage Stats Update.

Cause

During Tenant Usage Metrics polling (the Usage Stats Update stage), the system connects to hosting servers in order to provide usage data to WHMCS for usage billing-based invoicing and metrics.

This error occurs when there is a connection issue between WHMCS and the hosting servers. This may be due to incorrectly-configured servers in WHMCS or firewall or network issues between WHMCS and the server.

The most likely cause of this error is that you have an old server in Configuration () > System Settings > Servers that is no longer available.

The polling times out while WHMCS is waiting for data from the server, according to the configured PHP max_execution_time value. If this value is large, then the cron will wait for that amount of time.

Solution

To resolve the issue:

  1. Go to Configuration () > System Settings > Servers.
  2. Update or remove any inactive or offline servers from the list.
  3. Click Edit for each remaining server.
  4. Click Test Connection.
  5. If the test fails, check to ensure that the Server Name and Port values are correct, and then click Save.
  6. Repeat these steps for each server.

When the test succeeds for all of your servers, the server configurations are correct.

If the issue persists, it is due to an underlying firewall or connectivity issue between WHMCS and the servers. For example, this may be due to firewalls that have closed essential ports or have not whitelisted necessary hostnames.

Alternatively, you can disable Update Usage Statistics under Configuration () > System Settings > Automation Settings.

Contact your hosting provider or system administrator to resolve the issue and allow WHMCS and your hosting servers to connect.

Last modified: October 30, 2024