Downloading of report shows error or times out
If you receive an error such as “An error has occured” or similar when attempting to download the CSV file of a report, it is likely due to the request taking too long to process. The error occurs when there is a lot of records in the database and it is unable to extract the records within the default timeout of 30 seconds.
There are some solutions to this problem:
- The cause is limited read performance on the disk, increasing disk performance by using a Raid with SSD or NVMe is a more permanent solution.
- Disabling Advanced Reporting on some services can also help to reduce the amount of records, especially services with lots of active listeners/viewers.
- Increase PHP Timeout to 060 seconds (10 minutes) to prevent the page to timeout:
echo "max_execution_time = 600" > /usr/local/mediacp/php/php.d/custom.ini; mediacp restart php;
- Increase PHP-FPM editing /usr/local/mediacp/php/etc/php-fpm.d/www.conf and replacing the value for request_terminate_timeout to 600
- Increase nginx timeouts by adding the following in the http{} block of /usr/local/mediacp/nginx/conf/nginx.conf after the line containing fastcgi_cache_key
fastcgi_read_timeout 600; fastcgi_send_timeout 600; fastcgi_connect_timeout 600; proxy_connect_timeout 600s; proxy_send_timeout 600s; proxy_read_timeout 600s;
- Restart nginx
mediacp restart nginx