Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 05-04-2005 11:47:25

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Yes...

Code:

#########
######### If the cart exists, we know we can perform the update.
#########

if (-e "$data_temp_path/$fd_usr.$data_table_ext") {

Kevin Zaleski -  -

Offline

 

#27 05-04-2005 14:21:16

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Can you verify that the cart files are being deleted when the orders are placed?  Take a look at the ./data/temp directory and you should see a cart file (user number . csv) prior to the order being confirmed - then verify whether it's still there after the order is processed.


Nick Hendler

Offline

 

#28 05-04-2005 14:47:39

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

I have 485 carts in there, dated from April 24th to May 4th.
(Why is "5 days" the longest we can elect to store customer carts?)

There is no cart matching the User ID Number 51F4973831 for order CG200504282.

I'm now checking the return code from the unlink and logging failures (at least I hope this will work):

Code:

unlink "$data_temp_path/$fd_usr.$data_table_ext" or print (FILE "unlink failed $!\n");

So far the unlinks are all working fine for CC payments,
and the carts being unlinked in the debug code are indeed being removed from data/temp.

Guess I'll wait for a PayPal payment and see what happens...


Kevin Zaleski -  -

Offline

 

#29 05-04-2005 19:12:12

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

OK, progress: "unlink failed Permission denied"

Got this error on the last five paypal orders, not happening on CC orders...


2005-05-05 09:43:07 - ste_order_conf_sendemail_proc - Done sending out emails
2005-05-05 09:43:07 - unlinking /home/calmness/www/cgstore/data/temp/51F2680592.csv


yeti:~/www/cgstore/data$ cd temp
yeti:~/www/cgstore/data/temp$ ls -l 51F2680592.csv
-rwxrwxrwx    1 cg cg      1417 May  5 09:41 51F2680592.csv*

Permissions look fine, but this is happening consistently and only for PayPal carts.
What could cause permission problems unlinking PayPal carts???

Can't see how it can help, but here's the contents of the cart...

Code:

yeti:~/www/cgstore/data/temp$ cat 51F2680592.csv
cart_id,cart_prodid,cart_prodquantity,cart_prodname,cart_prodnumber,cart_prodoptions,
cart_prodoptionsinv,cart_prodshipped,cart_proddelmethod,cart_proddlfile,cart_prodshiplocal,
cart_prodshipint,cart_prodshipweight,cart_prodshiplength,cart_prodshipwidth,cart_prodshipheight,
cart_prodshipnumbox,cart_prodcustomship,cart_prodshiponename,cart_prodshiponeprice,
cart_prodshiptwoname,cart_prodshiptwoprice,cart_prodshipthreename,cart_prodshipthreeprice,
cart_prodshipemail,cart_prodshipstateprov,cart_prodshipcountry,cart_prodshipzip,
cart_amtprod,cart_amtstateprovtax,cart_amtcountrytax,cart_amtshipping,cart_amtrecur,
cart_shipmethod,cart_shipfirstname,cart_shiplastname,cart_shipcompany,cart_shipaddressone,
cart_shipaddresstwo,cart_shipcity,cart_shipstateprov,cart_shipcountry,cart_shipzip,
cart_shiprescom,cart_shipcomment,cart_usetaxstateprov,cart_usetaxcountry,cart_shipid,
cart_cat,cart_catstr,cart_url,cart_amtsinopt,cart_amtpmopt,cart_amtsinprd,cart_amtsinrecur,
cart_amtsinrecuropt,cart_amtstatus,cart_amtvol
1,235,50,Vinca minor Traditional<br>{Bare Root},74,,,Y,C,,,,0.000,,,,,ste_shipcus_user,,,,,,,shipments@ClassyGroundcovers.com,
,,,38.00,0.00,0.00,0.00,0.00,UPS/FedEx,Diane E,Jones,Jones Associates,59 Rt. 2,,
Harwick,Massachusetts,United States,02626,,,Y,Y,1,VINCA-minor,HOME:,,
0.00,+,0.76,0.00,0.00,V,1-49:1.14;50-249:0.76;250-999:0.56;1000-2499:0.53;2500-4999:0.52;
5000-9999:0.50;10000-19999:0.48;20000:0.45

Kevin Zaleski -  -

Offline

 

#30 05-08-2005 23:17:27

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

bump


Kevin Zaleski -  -

Offline

 

#31 05-16-2005 13:27:38

phunter121
Member
From: UK
Registered: 03-22-2004
Posts: 101
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

I feel that since I started this thread, I have sat back and watched everyone else do the work.

Kaz, you have clearly done a lot of work here, but I wondered whether you reached a final conclusion ?

PS. I am now getting up to 4 duplicate emails for Paypal order confirmations, so 


Peter Hunter

Offline

 

#32 05-16-2005 13:39:53

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

The only conclusion that I have reached is that CCP does not have permission to delete my carts that involve PayPal payments and this apparently causes the duplicate emails (as no emails would be sent for non-existant carts the second and third times the routine was called).

A Perlmaster suggests:

"A file can't be unlinked because something is holding the file at the moment. Maybe paypal involves additional processing or simply the file is not released properly. The number of close(HANDLE) statements must match the number of open(HANDLE, name) statements."

He's fairly certain that the problem is due to an unclosed filehandle, but further diagnosis requires logging every Open and Close of this cart file and I do not see where they are being done.
I need help from someone more familiar with the cart, or perhaps just better at perl.

NICK - there's at least four of us that this affects, will you please devote a few minutes to this? 
Who could still have the cart open?
If you do not know, can you at least tell me where all the opens and closes can be found?


Kevin Zaleski -  -

Offline

 

#33 05-19-2005 23:32:04

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

C'mon, Nick, it's been 16 days since your last response on this, can you please devote a few minutes?  This affects many besides me...


Kevin Zaleski -  -

Offline

 

#34 05-20-2005 09:50:19

phunter121
Member
From: UK
Registered: 03-22-2004
Posts: 101
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Can I add my weight to Kaz's request.

This is causing alot of pain. I get alot of phone calls from irrate customers thinking we have processed their order 2, 3 or even 4 times.

HELP !


Peter Hunter

Offline

 

#35 05-26-2005 00:26:42

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

If there's any truth to the rumour that Nick has survived the recent suicide bomber attacks, this thread would appreciate his response...


Kevin Zaleski -  -

Offline

 

#36 06-09-2005 12:55:17

phunter121
Member
From: UK
Registered: 03-22-2004
Posts: 101
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

any joy - anybody ?


Peter Hunter

Offline

 

#37 06-09-2005 13:00:09

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

no, but nick indicated that he plans to update the open forum issues soon so there's hope...


Kevin Zaleski -  -

Offline

 

#38 06-13-2005 20:43:09

thekiko
Member
Registered: 07-11-2002
Posts: 126

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Make that 5!

During heavy load, my CCP issues multiple confirmation emails.  We don't mind so much but our customers freak because they assume they are getting charged for every confirmation.  All of our payments are handled via Paypal so this is a pretty big issue.  The last memorable moment is when we got 10 duplicate emails for the same order - the poor lady just wanted one shirt. smile


TheKiko

Offline

 

#39 06-14-2005 12:54:38

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

I can guarantee all open filehandles are closed on cart reads.  This is all handled by DBD::AnyData (via SQL hitting the CSV files).

This is definitely a locking / permissions issue with the deletion of the files that only appears to happen under certain circumstances. 

What is common to these five installs that is not common to all others using PayPal?

Are each of you using Zues webserver?

Do each of you have IPN enabled?

Have any of you removed the locking mechanizm in ./cgi-bin/library/common/initialize.pl?

Consider trying this (on Unix/Linux servers only):

Where you see:

Code:


unlink "$data_temp_path/$fd_usr.$data_table_ext";

Comment that line out and try replacing that with a system command instead (using the OS to do the delete instead of Perl):

Code:


`rm -f $data_temp_path/$fd_usr.$data_table_ext`;

Does that do anything for you?


Nick Hendler

Offline

 

#40 06-14-2005 16:25:54

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Tried it, no help...

2005-06-14 16:17:06 - cart /home/calmness/www/cgstore/data/temp/51F6022431.csv exists
2005-06-14 16:17:06 - calling &ste_order_conf_sendemail_proc('Y','Y','Y') from ste_order.pl, line 2469
2005-06-14 16:17:06 - ste_order_conf_sendemail_proc called: 06/14/2005 16:17:06
2005-06-14 16:17:06 - sending primary order email - Classy Groundcovers - Order Confirmation - CG2005061410
2005-06-14 16:17:06 - ste_order_conf_sendemail_proc - Done sending out emails
2005-06-14 16:17:06 - rm -f /home/calmness/www/cgstore/data/temp/51F6022431.csv

2005-06-14 16:17:12 - cart /home/calmness/www/cgstore/data/temp/51F6022431.csv exists
2005-06-14 16:17:12 - calling &ste_order_conf_sendemail_proc('Y','Y','Y') from ste_order.pl, line 2469
2005-06-14 16:17:12 - ste_order_conf_sendemail_proc called: 06/14/2005 16:17:12
2005-06-14 16:17:12 - sending primary order email - Classy Groundcovers - Order Confirmation - CG2005061410
2005-06-14 16:17:12 - ste_order_conf_sendemail_proc - Done sending out emails
2005-06-14 16:17:12 - rm -f /home/calmness/www/cgstore/data/temp/51F6022431.csv

2005-06-14 16:17:14 - cart /home/calmness/www/cgstore/data/temp/51F6022431.csv exists
2005-06-14 16:17:14 - calling &ste_order_conf_sendemail_proc('Y','Y','Y') from ste_order.pl, line 2469
2005-06-14 16:17:14 - ste_order_conf_sendemail_proc called: 06/14/2005 16:17:14
2005-06-14 16:17:14 - sending primary order email - Classy Groundcovers - Order Confirmation - CG2005061410
2005-06-14 16:17:15 - ste_order_conf_sendemail_proc - Done sending out emails
2005-06-14 16:17:15 - rm -f /home/calmness/www/cgstore/data/temp/51F6022431.csv

I'm on RedHat Linux, have not modified initialize.pl and do not know what IPN is.

Given that the permissions are correct, I'm not aware of any way that "rm -f" can fail other than the file being open (I was a UNIX developer for 20 years). I confirmed this by doing a "mv" instead of a "rm":

Code:

`mv $data_temp_path/$fd_usr.$data_table_ext $data_temp_path/$fd_usr.$data_table_ext.foo`;

and indeed only one set of emails is sent...

Code:

2005-06-14 16:29:10 - cart /home/calmness/www/cgstore/data/temp/51F6022431.csv exists
2005-06-14 16:29:10 - calling &ste_order_conf_sendemail_proc('Y','Y','Y') from ste_order.pl, line 2469
2005-06-14 16:29:10 - ste_order_conf_sendemail_proc called: 06/14/2005 16:29:10
2005-06-14 16:29:10 - sending primary order email - Classy Groundcovers - Order Confirmation - CG2005061411
2005-06-14 16:29:10 - ste_order_conf_sendemail_proc - Done sending out emails
2005-06-14 16:29:10 - mv /home/calmness/www/cgstore/data/temp/51F6022431.csv /home/calmness/www/cgstore/data/temp/51F6022431.csv.foo

... but this is not an ideal solution as the carts will not be deleted this way (I guess I can add a cron job to clean them up periodically, but I'd prefer to diagnose and fix the problem).

I want to figure out where the carts are still open and close them properly.
Can you please tell me all the places where the carts are opened and closed (or tell me how to identify them) so I can add debugs for every open and close and identify the culprit?

Why is ste_order_conf_proc being called three times a few seconds apart (for PayPal orders)?


Kevin Zaleski -  -

Offline

 

#41 06-16-2005 12:58:42

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

I can't say why it's being called three times.  It should be called twice - once when paypal sends it's IPN request and once when the customer hits the page.  Post your Form Content section of your PayPal setup and I'll see if I can see anything more from that. 

As far as debugging the filehandle issue - those filehandles are not opened and closed by CCP code, rather by the Perl module DBD::AnyData when it calls DBD::File (/cgi-bin/modules_lib/DBD/File.pm).  DBD::File uses File::IO to do it's file tricks.

Because DBD::AnyData uses DBD::File which in turn calls File::IO, I have to assume the open filehandle issue is resident either in the Perl 'File' module, or in Perl itself.

What version of Perl are you running?  What about the other questions I asked?  Like what's your OS, Perl version, etc.


Nick Hendler

Offline

 

#42 06-16-2005 13:51:20

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

After verifying your order information and clicking the 'Submit' button, you will be directed to PayPal's secure site to enter your payment information. Once your payment information is entered and verified, you will be directed back to this web site for your order confirmation.<BR><BR>

<FORM METHOD="POST" ACTION="https://www.paypal.com/cgi-bin/webscr">

<!-- ### -->
<INPUT TYPE="HIDDEN" NAME="business" VALUE="shop@ClassyGroundcovers.com">
<!-- ### -->

<INPUT TYPE="HIDDEN" NAME="bn" VALUE="(CGIVAR)release_verbuild(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="undefined_quantity" VALUE="0">

<INPUT TYPE="HIDDEN" NAME="item_name" VALUE="Online Order">

<INPUT TYPE="HIDDEN" NAME="item_number" VALUE="(CGIVAR)tracking_id(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="custom" VALUE="(CGIVAR)fd_usr(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="first_name" VALUE="(CGIVAR)tracking_firstname(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="last_name" VALUE="(CGIVAR)tracking_lastname(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="address1" VALUE="(CGIVAR)tracking_addressone(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="address2" VALUE="(CGIVAR)tracking_addresstwo(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="city" VALUE="(CGIVAR)tracking_city(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="state" VALUE="(CGIVAR)tracking_stateabbus(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="country" VALUE="(CGIVAR)tracking_country(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="zip" VALUE="(CGIVAR)tracking_zip(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="email" VALUE="(CGIVAR)tracking_email(/CGIVAR)">

<INPUT TYPE="HIDDEN" NAME="notify_url" VALUE="(CGIVAR)common_url_form(/CGIVAR)">

(CGIGET TYPE="SUB" VALUE="ste_olp_recur" PARAMS="ste_gw_paypalpp")

<CENTER>

<INPUT TYPE="IMAGE" SRC="(CGIVAR)images_path(/CGIVAR)/button/submit_submit.gif" WIDTH="(CGIVAR)site_button_image_width(/CGIVAR)" HEIGHT="(CGIVAR)site_button_image_height(/CGIVAR)" BORDER="0" VALUE="submit"> <A HREF="(CGIVAR)seo_base_url(/CGIVAR)/page----cancel"><IMG SRC="(CGIVAR)images_path(/CGIVAR)/button/submit_cancel.gif" WIDTH="(CGIVAR)site_button_image_width(/CGIVAR)" HEIGHT="(CGIVAR)site_button_image_height(/CGIVAR)" BORDER="0"></A>

</FORM>

</CENTER>

Perl V5.6.0 under RedHat Linux.


Kevin Zaleski -  -

Offline

 

#43 06-17-2005 07:46:05

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

Well that's bone stock and you're using the same OS & Perl version we are here so that's not it either.  Are your permissions correct on the ./data/temp directory (chmod 777)?


Nick Hendler

Offline

 

#44 06-20-2005 02:19:25

phunter121
Member
From: UK
Registered: 03-22-2004
Posts: 101
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

This may not be that relevant, but I checked all of my order confirmations. I have been accepting paypal for over a year now, but the the first time duplicate paypal order confs started to occur was at the beginning of Feb 05. 


Peter Hunter

Offline

 

#45 06-21-2005 09:37:18

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

I'll do a little research on this and see if PayPal made any changes to their system around that time.


Nick Hendler

Offline

 

#46 06-23-2005 17:07:23

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

My permissions are correct on ./data/temp


Kevin Zaleski -  -

Offline

 

#47 06-24-2005 08:01:13

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

bump


Nick Hendler

Offline

 

#48 06-24-2005 08:36:32

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19925
Website

Re: Why Is Ccp Suddenly Generating Duplicate Emails

This problem coupled with the Authnet AIM issue you're experiencing really points to a server side issue.  Perhaps the server is not up to spec.  With the number of orders you're receiving you may be taxing the server too much.  Have you considered switching to a higher powered server?


Nick Hendler

Offline

 

#49 06-24-2005 09:29:07

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

webmaster,06/24/2005 08:36:32 AM wrote:

Have you considered switching to a higher powered server?

I did that (), didn't help.


Kevin Zaleski -  -

Offline

 

#50 07-01-2005 10:29:11

kaz
Member
Registered: 05-19-2004
Posts: 583

Re: Why Is Ccp Suddenly Generating Duplicate Emails

bump


Kevin Zaleski -  -

Offline

 

Board footer