Matomo Cron Archiving Fails – 503 Service Temporarily Unavailable & Unserialization Errors

The website displays a “503 Service Temporarily Unavailable” error, which appears to be related to the archive job. While running the Matomo cron archive script, I am encountering repeated error messages indicating that API responses are not being returned in the expected JSON format. Instead, the server returns an HTML response with the error “503 Service Temporarily Unavailable”. This causes the unserialization process to fail, leading to numerous errors.

Log Details:

• Repeated messages such as:

<HTML>
503 Service Temporarily Unavailable
</HTML>

• Unserialization errors for API responses, for example:

Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=2&period=day&date=2025-01-16&format=json&trigger=archivephp: '<HTML> 503 Service Temporarily Unavailable </HTML>'

• The script ends with a summary message:

36 total errors during this script execution, please investigate and try and fix these errors.

(reported in CronArchive.php, line 648)

Environment:
Matomo Version: 5.2.1
PHP Version: 8.3