perarg Posted September 9, 2017 Share Posted September 9, 2017 (edited) Hello, i have developed a website some months ago. Everything was fine until last week where suddenly a huge delay has appeared in the last step of placing an order, where a customer should press the button Confirm Order. Of course i choose to test only bank transfer as payment method so not to have other third parties to consider. So, after pressing the confirmation button, there is over 120sec of waiting and after that the confirmation page is appeared. As you may understand, it's unacceptable for a e-shop to have such a delay. Many customers do refresh and other re-order things twice... There is another one section of the website that the same delay has suddenly appeared. It's on administration's side in Orders page where the administrator has to change the Order Status. When the order changes and the button is pressed we have to wait about 120sec to make the change! (I tried to retain the same order status and just press the button to see what happens and a message of 'The new order status is invalid.' is appeared immediately. The problem is when someone changes the status) I have disabled the email sending process without any change at all. Trying to send an email from the back office, the email is sent immediately without any delay, so i don't think it is related to the problem. The common thing between order status change and order confirmation page, is that in both situation the order is changing its status. I thought that it is a point to start with... But i am really stuck here, i don't know where to search ? What to look up ? Please, do you have any advice, any help... It will be really appreciated P.S. I forgot to mention that the site is in Prestashop 1.6.1.12 (it cannot be updated for any reason, it's another story). In the same server i have an older copy of the e-shop, i test it in a subdomain and there is no delay. Of course it's an old copy as i said and a lot of things missing as some payment gateways or shipping carriers. But i think that with this test, i clarify that this isn't happening due to server load or server quality. (I am hosting at DigitalOcean.com) Edited September 16, 2017 by perarg (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 (edited) Your description let me assume you have a problem with sending mails. If you use SMTP as mail setup, both order confirmation and some order status change result in sending out mails. If these mails use SMTP, there might be the culprit in connection to this remote host. If appropriate I always recommend to use PHP mail function instead of SMTP. You might also look into your webservers error log. It might give you some hint if an error condition occures which results in these delays. Edited September 9, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 The order creation yes sends email through SMTP. As i wrote in my first post, i tried to disabled email sending through Advanced Parameters -- Email -- Never send emails (may be useful for testing purposes). No difference. But in order status change there are statuses like Payment awaiting or Cancel order that don't have email sending enabled. I try with these and the delay is here... I am going crazy, i really don't know where to check... Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 Look into your error logfile. Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 (edited) What error logfile ? In Advanced Parameters -- Logs there are no errors, just my actions. Edited September 9, 2017 by perarg (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 (edited) No, your webservers logfile. You cannot access this from the backoffice since this error logfile is related to your hosting and not directly to prestashop. Usually one can access this via webhosting panel or via SSH access. Edited September 9, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 (edited) I check /var/log/nginx/error.log file but there is nothing relevant to my issue. Almost everything is about module gapi (i think google analytics module) where it is thrown an error: PHP message: PHP Fatal error: Uncaught Error: Unsupported operand types in /var/www/e-sea.gr/html/controllers/admin/AdminStatsController.php:537 Stack trace: #0 /var/www/e-sea.gr/html/classes/controller/Controller.php(204): AdminStatsControllerCore->displayAjaxGetKpi() #1 /var/www/e-sea.gr/html/classes/Dispatcher.php(367): ControllerCore->run() #2 /var/www/e-sea.gr/html/**backoffice_url**/index.php(58): DispatcherCore->dispatch() #3 {main} thrown in /var/www/e-sea.gr/html/controllers/admin/AdminStatsController.php on line 537" while reading response header from upstream, client: 79.166.116.1, server: www.e-sea.gr, request: "GET /**backoffice_url**/index.php?controller=AdminStats&token=5cd2b1834f1ed445df As you can see the url of the website is https://www.e-sea.gr, but the above errors is concerned the Dashboard status and not relevant to the delay. It is something with database or presta files for sure... There is no issue with the server. I am pretty sure. Edited September 9, 2017 by perarg (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 In my personal opinion, you have first to get rid of these errors. It is not unlikely they affect your shop in other areas as well. We don't know your exact setup at all. But PHP fatal errors should not occur at all. And it is nearly impossible to figure out if some kind of these errors also result in delays as you have described them. Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 Yes i think your approach is in right direction. I disabled the gapi module and the errors have been stopped. There is no difference on the delay problem though... Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 (edited) You could start debugging your code with some timestamps. There is a cool method.... PrestaShopLogger::addLog("This is my debug log created at timestamp : " . time(), 1, null); If I were you, I would add this code in Mail.php at the beginning of public static function Send and ad the end of this function. Comparing the timestamps allows to figure out if this delay comes from mail sending - what i still think. Or go the easy way and enable PHP mail for a short test. If your delay is gone away with that, it is SMTP for sure. Edited September 9, 2017 by Scully (see edit history) 1 Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 I really appreciate your help Scully. Ok i don't have any problem to test anything. But as i said twice, i do my all tests changing the order status to statuses that DON'T send any email at all. So, putting the method addLog to Mail.php will not log anything... Having this in mind, how the mail connection may related to the delay where no email is sent ? Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 (edited) Order confirmation always sends mails, that is where your initial post started - but you can use this method to debug everywhere. Edited September 9, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
perarg Posted September 9, 2017 Author Share Posted September 9, 2017 After many many tests with your method Scully, i find out that the mailchimp module is responsible for the delay! It was indeed a third party that causes the delay and i found out with your way Scully. Thank you very much, i appreciate that Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 Very cool. Mailchimp is known to cause huge delays in some installations. There ore quite some topics on that. You might add 'SOLVED' to your topic title. 1 Link to comment Share on other sites More sharing options...
octb Posted September 25, 2017 Share Posted September 25, 2017 Hi, I had the exact same problem and the mailchimp add-on looks like it was the cause, i deleted it and after a few tests everything works fine. I'll get back with an update if the problem reappears. Thanks for the info! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now