Describe the bug
We have about 5300 expired cart rules / discount vouchers.
If I want to edit any of those - 504 gateway timeout - need to reboot VPS server
If I want to bulk delete 20 - OK
If I want to bulk delete 100 and more - 504 gateway timeout - need to reboot VPS
I'm sure that deleting 1000 at once should not be an issue but it is.
The question is, how can I delete 1000 at once? Not sure if it could be deleted directly from the database without breaking some relations.
Additional information
PrestaShop version: 1.7.5.1
PHP version: 7.3.8
Memory limit: 1024M
Max execution time: 1200
MySQL version: 10.3.17-MariaDB
VPS
2 vCPU (KVM)
6 GB RAM
Prestashop 1.7.5.1 is not compatible with PHP 7.3.8. Try to downgrade to PHP 7.2
Thank you for your answer @MathiasReker
@mrabsinthe I let you change your PHP version and tell us if you still have the same issue
Officially not, but it has been running on PHP 7.3 since it came out and there were no PHP version related issues. I sincerely doubt that this issue is caused by the PHP version.
But to be sure, I've just tested under PHP 7.2.21 and the issue is exactly the same - 504 gateway timeout - need to reboot VPS.
Hi @mrabsinthe,
Could you please provide us with more info? We need more details to understand how we can reproduce your issue:
Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/
Thanks!
Hi, I hope it helps, not easy to do testing since it is live server...
Debug enabled but no output or report.

I have checked both the PHP error log and the apache error log. From the PHP error log, I could not find any valid entries for the domain.
Upon inspecting the apache error log on the server, I could find some errors which are dated on Aug 12,13. The latest errors reported is attached below and it is something related to timeout.
[Tue Aug 13 04:47:50.925623 2019] [proxy_fcgi:error] [pid 3335:tid 47844211447552] (70007)The timeout specified has expired: [client 111.11.111.11:2220] AH01075: Error dispatching request to : (polling), referer: https://www.myliveserver.com/admin/index.php?controller=AdminCartRules&token=b2b9e1... etc. etc.
[Tue Aug 13 04:48:20.958678 2019] [proxy_fcgi:error] [pid 3335:tid 47844211447552] (70007)The timeout specified has expired: [client 111.11.111.11:2220] AH01075: Error dispatching request to : (polling), referer: https://www.myliveserver.com/admin/index.php?controller=AdminCartRules&token=b2b9e1... etc. etc.
@mrabsinthe, could you please try to increase the "timeout" found it in the php.ini file.
Thanks for check and feedback.
there is no timeout, see below complete php.ini:
date.timezone = "US/Central"
display_errors = Off
max_execution_time = 1200
max_input_time = 600
max_input_vars = 10000
memory_limit = 1024M
post_max_size = 20M
session.gc_maxlifetime = 1440
session.save_path = "/tmp"
upload_max_filesize = 64M
zlib.output_compression = On
asp_tags = Off
extension = memcached.so
allow_url_fopen = On
allow_url_include = Off
enable_dl = Off
file_uploads = On
Hi @mrabsinthe,
Could you please try to increase the "max_execution_time".
Thanks for check and feedback.
1200 is already quite high in my opinion, however increasing it to 2400 sorted the issue and I'm able to bulk delete 1000 cart rules. The problem is that even 2400 might not be enough if you have 10000+ cart rules there and you need to either delete or edit. The script should pause to avoid timeout.
Hi @mrabsinthe,
Could you please follow this link: https://github.com/PrestaShop/php-ps-info
The phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

Thanks to check and feedback.

@mrabsinthe, I tried to delete 1000 cart rules with PS1.7.6.0 & it is OK
I attached a screen record
https://drive.google.com/file/d/1tRdiloueflh6fchkSwj0qgAC_O2nHwvO/view

Thanks!
Can you please try to delete them when you have total of 5300 vouchers/coupons?
@mrabsinthe, it is OK
https://drive.google.com/file/d/1E9ZE1nXidre2PGncSqATb_JMxs2JrNlD/view
Thanks!
Not sure why it was not working, perhaps the fact that none of those vouchers was same, each one was with unique number, each with different expiration date and unique discount. Many of them issued to individual customers for birthday or abandoned cart. That is why I had to increase the "max_execution_time" so much. I tested on PrestaShop version: 1.7.5.1 only so maybe some changes were done to 1.7.6
@mrabsinthe, I tried with PS1.7.5.1 & it is OK
https://drive.google.com/file/d/1Ji1i-tPSD_NU-slpKBNF4kj3nyoB4FhR/view
Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.
Thanks!