Post by Cold Storage » Mon Dec 06, 2021 1:00 am

I started by searching for similar issues and did not note any. If this questions already has a dedicated thread, apologies for the clutter.

OC ver 3.0.3.6
Theme: Default X-Theme
(Additional) Installed Extensions: Disable Add To Cart When Out Of Stock, Inventory report menu, MailChimp Integration, Out of Stock, Sanekdev Payment Icons, [underr] Sort By Newest
(Additional) Installed Translation(s): None

Issue:
On Fri Dec 3rd I sent out my weekly mailchimp update and noticed that no order email notifications were arriving in my mailbox. I looked into it and new orders were being placed but I was not getting emails. The orders did appear in my admin and they did appear in my shipstation queue so, besides the email everything was functioning. I tinkered around with the email settings trying to get STMP to work but was not able to fix. I planned to circle back and fix at my earliest convenience since I don't need the emails and it did not occur to me that my customers would not receive emails too. Fast forward to this morning (Sun December 5th)and I have a bunch of customers emailing me that now their cards have been charged multiple times for orders but when i look for those orders in my admin area they do not exist. (Or so it seems). What I have been able to piece together is that when people press pay the card is being charged, an order number is being assigned to the purchase, but that order number doesnt show up in my order queue.

Attached is a snapshot of my admin panel, you can see the multiple purchases in the activity table (left) but nothing in the latest orders table (right):

Besides tinkering w/ the email settings in the admin panel I have made zero changes to anything on my end. When I logged into my host it had a message for me that said: "Congrats! We've just boosted your servers speed with new NVMe SSD hardware.". Could this possibly be the culprit?

The site is Klaxon-Records.com, however I had to put it in maintenance mode to limit customers from submitting charges repeatedly.

Attachments

Screen Shot 2021-12-05 at 8.51.07 AM.png

admin screen showing successful charges - Screen Shot 2021-12-05 at 8.51.07 AM.png (545.83 KiB) Viewed 1577 times


Newbie

Posts

Joined
Mon Feb 22, 2021 5:59 am

Post by straightlight » Mon Dec 06, 2021 1:09 am

Server maintenance. Also check your error and payment logs regarding the pay button. It is also possible that your maximum tolerance daily level has been exceeded with SMTP (not STMP) to send the mass emails to your contacts / customers since.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Mon Dec 06, 2021 1:23 am

Do the orders show under missing orders? What payment extensions are you using? Have you switch on the debug logging in you payment extensions and looked at the logs?

Have you checked both the PHP and OpenCart error logs?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Cold Storage » Mon Dec 06, 2021 1:25 am

straightlight wrote:
Mon Dec 06, 2021 1:09 am
Server maintenance.
Do you mean that my site is in maintenance (I did this to prevent more customers from jamming charges in) or that the error was created by my host doing server maintenance on their end?
straightlight wrote:
Mon Dec 06, 2021 1:09 am
Also check your error and payment logs regarding the pay button. It is also possible that your maximum tolerance daily level has been exceeded with SMTP (not STMP) to send the mass emails to your contacts / customers since.
I pulled the error logs from admin. I attached the last few days of data here to this post. Its probably not the best way to do it but the full dump was 15mb. Im no expert (doubt I need to say that) but I only see things related to errors from when I was trying to get SMTP working. (Prior to that I was just using the "mail" setting in admin that didnt require any credentials like SMTP does)

Newbie

Posts

Joined
Mon Feb 22, 2021 5:59 am

Post by Cold Storage » Mon Dec 06, 2021 1:32 am

ADD Creative wrote:
Mon Dec 06, 2021 1:23 am
Do the orders show under missing orders? What payment extensions are you using? Have you switch on the debug logging in you payment extensions and looked at the logs?

Have you checked both the PHP and OpenCart error logs?
The orders DO show under missing orders! I had not thought to look there. Thanks! So I guess this means that OC doesnt recognize the order as completed? It is not changing the status when the card is charged?

My payment processor is CardConnect. I will look for the logs there (assuming they are turned on) and update the thread with my findings.

I checked OC error logs, im assuming the PHP logs will come from my host, so am looking for how to pull those now.

Thanks!

Newbie

Posts

Joined
Mon Feb 22, 2021 5:59 am

Post by ADD Creative » Mon Dec 06, 2021 5:55 am

Looking at you errors logs I can see.
PHP Warning: fsockopen(): unable to connect to smtp.gmail.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/jb1styl5ul7r/public_html/system/library/mail/smtp.php on line 87
This means that the attempt to connect to your SMTP server failed.

Unfortunately there is a bug in OpenCart in that if the sending of SMTP mail fails, the order doesn't complete. You will need to correct your SMTP settings or use Mail as the Mail Engine.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Cold Storage » Mon Dec 06, 2021 9:52 am

ADD Creative wrote:
Mon Dec 06, 2021 5:55 am
Unfortunately there is a bug in OpenCart in that if the sending of SMTP mail fails, the order doesn't complete. You will need to correct your SMTP settings or use Mail as the Mail Engine.
This is great to know! I was using Mail as the Mail Engine but when that stopped working mysteriously on Dec 3rd, I tried to switch to SMTP and I had left the SMTP switch thrown which caused the order failures. Switching back to Mail seems to have resolved the issue with ordering at least.

Now I need to figure out why Mail stopped working or get SMTP to work.

Your help on my issue is greatly appreciated.

Newbie

Posts

Joined
Mon Feb 22, 2021 5:59 am

Post by by mona » Mon Dec 06, 2021 10:33 am

Code: Select all

PHP Warning: fsockopen(): unable to connect to smtp.gmail.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known)
This (getaddrinfo failed) may well mean that your host has a dns problem as it cannot find the ip address for host name smtp.gmail.com
This can happen incidentally but since you have many of these, better contact your host.

And yes, OC has this design flaw where email sending is in the critical path of the order confirmation process flow making it slow and fragile.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Mon Dec 06, 2021 8:26 pm

by mona wrote:
Mon Dec 06, 2021 10:33 am
And yes, OC has this design flaw where email sending is in the critical path of the order confirmation process flow making it slow and fragile.
Yikes, is this reported as an issue on Github?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ADD Creative » Mon Dec 06, 2021 8:41 pm

paulfeakins wrote:
Mon Dec 06, 2021 8:26 pm
Yikes, is this reported as an issue on Github?
Yes a few times. The issues always get closed.
https://github.com/opencart/opencart/issues/7633
https://github.com/opencart/opencart/issues/9477

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Mon Dec 06, 2021 10:28 pm

The biggest problem with sending emails (does no matter if native mail or SMTP is used), is the process how an order is made and when the order is valid.

Valid in the sense of the customer, because the order is not made (and not valid), if the customer is not receiving any written confirmation (does no matter if yellow post, email or carrier pigeon).

The laws in many countries - especially in the EC - are saying, that an order is not valid when the customer is not notified (message, paper, etc.) > a simple notice on the screen is NO confirmation.

Based on that, the whole order process should be reworked:
1. customer is making an order
2. data is (pre)stored in database
3. customers will be notified (by email)
4. if 2. & 3. are valid, the order will be confirmed (in the system), otherwise "on hold"
5. customer will be notified of the successful order - or that the order could be not placed (on the screen).

Now if the transportation/notification (here by email) is not done or available (does no matter what may the reason here), the system should try it again after a defined time (depending/based on the error message, because if the email address or/and server does not exist [because of a joke], the order is obsolete and can be deleted [or confirmed]).

In all cases, the notification must be done before (4), because further process is depending on it.

Of course, you could disable the notification per email and send a delivery courier or carrier pigeon .. but who will do such?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by by mona » Tue Dec 07, 2021 9:35 am

My tuppence worth ..

The EU does create some nice theoretical laws, but rarely do ‘politicians’ actually know what they are suggesting, nor care if it works, it is just getting paid by us mere mortals to be seen to be doing - I am still rather driven insane and feeling somewhat angry with them for their bright idea of cookie law !!!!! One can only hope it causes them such daily frustration as it causes the rest of us ::)

However, what do they define as being "electronically notified"?
-When the confirmation screen is send?
-When the email is send?
-When the email arrives?
-When the email is opened?

All you can know with smtp is whether you mail server has accepted the email for sending.
To verify if it has actually send it, you would have to read it's logs.
Even then there is no way to determine if the email has actually arrived or has been opened.
When using the mail engine of OC, it is not checked if the email has been accepted by your mail server, hence these problems never occur there as they are ignored.

Even today, email delivery is a "best effort" external dependency which is not dependable for critical processes and should never impede order processing.

In short:
- Take the email sending out of the checkout flow and store them in a queue in the database.
- Process that queue at intervals to send out the pending emails by job.
That way you also have a copy of the emails send and are able to re-send in case your mail server is down.

Whether you set the order status prior to sending to "on hold" and update it to "confirmed" after sending is arbitrary.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by OSWorX » Tue Dec 07, 2021 3:40 pm

by mona wrote:
Tue Dec 07, 2021 9:35 am
The EU does create some nice theoretical laws, but rarely do ‘politicians’ ...
Has nothing to do with 'politicians', it' s simply the ecommerce rules.
Because, you can make an order in 2 ways:

Customer makes the order (in the shop) and click finally the button "Confirm" - or better to comply the rules here: "Confirm & Pay".
Now the order can have 2 states:

1. "order" is made, but at least not confirmed by the shop (because it is a so called "offer").
As long as the shop does not not confirm that the order has been accepted, the order is not valid.

2. "order" has been made and is immediately confirmed as order

(This "process" and when a order is an order has to be published in the TOS - "Terms of Service" and is very important).

In both scenarios a confirmation has to be send (to the customer/buyer), otherwise none of them is valid.
That's a a very simple rule, and the state of the order is very important!
Because in the EC everyone can withdraw his order within 14 days without any further reason.

Which means also, the customer has to be informed about the order - and the state.
Without any information, the whole process can not start.

We're here not in India or Russia or somewhere else where every shopowner can make what he wants - this times are gone forever.
And those rules are to protect both parties - the seller and the buyer.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Tue Dec 07, 2021 8:06 pm

ADD Creative wrote:
Mon Dec 06, 2021 8:41 pm
paulfeakins wrote:
Mon Dec 06, 2021 8:26 pm
Yikes, is this reported as an issue on Github?
Yes a few times. The issues always get closed.
https://github.com/opencart/opencart/issues/7633
https://github.com/opencart/opencart/issues/9477
:(

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by paulfeakins » Tue Dec 07, 2021 8:09 pm

by mona wrote:
Tue Dec 07, 2021 9:35 am
The EU does create some nice theoretical laws, but rarely do ‘politicians’ actually know what they are suggesting, nor care if it works, it is just getting paid by us mere mortals to be seen to be doing - I am still rather driven insane and feeling somewhat angry with them for their bright idea of cookie law !!!!! One can only hope it causes them such daily frustration as it causes the rest of us ::)
100% correct.

Like Elon Musk said it should be a browser setting (if anything). Because there are about 1 billion websites on the Internet - should they all be responsible for policing their own cookies? Or perhaps just the ~10 biggest browsers could make a small setting and save annoying everyone!

Luckily since leaving the EU, we (in the UK) will soon not need cookie popups: https://www.bbc.co.uk/news/technology-58340333

(Not that I've ever bothered with them on my sites.)

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 102 guests