Articles on: Amazon Marketplace (PrestaShop)

Cloudflare 524 error when running cron (timeout issue)

The cron is failing due to a Cloudflare 524 error. This means the request takes longer than Cloudflare’s maximum HTTP execution time (usually around 100–120 seconds).


Even if the cron is scheduled via the server (crontab), if it is still executed through an HTTP URL protected by Cloudflare, Cloudflare may stop the request before the script finishes.


You can find more information here:

https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-524/



Why this happens


The error occurs because:


  • the script is too heavy (large catalog / stock / order processing)
  • Cloudflare imposes a strict timeout on HTTP requests
  • the PHP script continues running on the server, but the HTTP connection is already closed




The recommended fix is to run the cron using PHP CLI (command line) instead of HTTP.


This removes Cloudflare entirely from the process and avoids any timeout limits.


Example (HTTP version – current problem)


https://myshop.com/modules/amazon/functions/check_stock.php?cron_token=XXXX&mkp=XXXX&fix=1




Your server administrator should use a command like:


/usr/bin/php /path/to/your/prestashop/modules/amazo/functions/check_stock.php cron_token=XXXX mkp=XXXX fix=1



Important notes for server configuration


Please ask your hosting provider to:


  • replace the HTTP cron URL with a PHP CLI command
  • ensure the correct absolute path to your PrestaShop installation is used
  • verify the correct PHP CLI binary path (example: /usr/bin/php, /usr/local/bin/php, etc.)


In CLI mode:


  • there is no https:// URL
  • ? and & are replaced by spaces
  • execution is not limited by Cloudflare timeout




You can also:


  • increase Cloudflare timeout limits (if your plan allows it)


However, this is not always reliable for heavy catalog synchronizations.



Recommendation


For large catalogs or frequent synchronization jobs, CLI execution is the most stable and recommended solution, as it fully avoids Cloudflare HTTP limitations and prevents 524 errors.

Updated on: 15/05/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!