Print Page | Close Window

Error -2147217833 IP Address would be truncated

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=4795
Printed Date: 01-November-2024 at 12:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Error -2147217833 IP Address would be truncated
Posted By: odathp
Subject: Error -2147217833 IP Address would be truncated
Date Posted: 11-October-2011 at 12:56pm
We have another case where ProductCart is capturing a customer IP with a port number attached to it.

The error -2147217833 indicates "String or binary data would be truncated" (since the pcOrd_CustomerIP field can not store an IP address longer then 15 characters).

Here are examples of the IP.  There port number is different every time.

166.147.115.128:23149
166.147.115.128:13513
166.147.115.128:17877
166.147.115.128:27034

Please, if anyone can shed some light on this we would be extremely grateful.

We have lost one customer because of this bug in ProductCart.



Replies:
Posted By: Hamish
Date Posted: 11-October-2011 at 1:27pm
Hi,
   I suspect a server issue - your site should only be accessible via the standard ports, 80 & 443 AFAIK.
Is the customer deliberately putting different ports in -  If so why!? 


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: odathp
Date Posted: 11-October-2011 at 1:59pm
The IP I mentioned is not the site IP.  It is the customer IP.

ProductCart is capturing the customer IP with a port number attached.  It cannot save the customer IP since it exceeds the field length in the database.

What does capturing the customer IP have to do with accessing the site via non standard ports?

The only other clue I have is this customer IP is listed on Spamhaus.

http://www.spamhaus.org/query/bl?ip=166.147.115.128" rel="nofollow - http://www.spamhaus.org/query/bl?ip=166.147.115.128

Our other customer that had this problem was listed on CBL, but has since been removed.


Posted By: Hamish
Date Posted: 11-October-2011 at 2:24pm
Of course your right about the IP address! 
I suspect the PC may have been compromised, but beyond that I'm stumped. Do you have enough info from the failed order to contact the customer to see if they are deliberately doing something unusual? If not, then I suspect they would appreciate the call as, if their PC has been compromised then any transactions they carry out will quite likely lead to their card & personal details being compromised as well. If it is deliberate it would be V interesting to know what they are doing @ why!!    

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: odathp
Date Posted: 11-October-2011 at 3:33pm
Yes, we did call the customer and are waiting for him to call back.

I still think there is something fishy with ProductCart code that queries a visitor IP and returns the IP with port number.  I think in ASP you have to specifically request the client port number.

Request.ServerVariables("remote_addr")

vs.

Request.ServerVariables("remote_port")



Posted By: Hamish
Date Posted: 11-October-2011 at 4:48pm
Hi,
   I investigated & it seems we test HTTP_X_FORWARDED_FOR first, so I believe some work is required, but I also couldn't find any references to HTTP_X_FORWARDED_FOR returning the port number.  Ask your customer if they are using a proxy server.  

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: Wonderfulnews
Date Posted: 16-September-2012 at 4:50pm
All,

I am wondering if and how this issue was resolved. I too have customers complaining about this problem AND have been able to replicate it myself when using a retail wireless router between the cable modem and the desk top computer.

Error Number: -2147217833
Source: Microsoft OLE DB Provider for SQL Server
Description: String or binary data would be truncated.
CustomerIP='123.237.252.153:59147'

thoughts?


Posted By: Guests
Date Posted: 17-September-2012 at 4:58pm
As of v4.5 this appears to have been addressed in one location, but not in two others.

The fix appears in /pc/opc_GateWayData.asp

It should also be followed through on the following pages:

/pc/pcPay_GoogleCheckout_Notification.asp

find: 
'// Update Risk Management Status

Just above it add:
'save only the first 15 characters in case this is returned as a list of IP addresses
pcv_strIpAddress = left(pcv_strIpAddress,15)

In /pc/pcGateWayData.asp find:
'SAVE customer IP to order

Just above it, add:
'save only the first 15 characters in case this is returned as a list of IP addresses
pcCustIpAddress = left(pcCustIpAddress,15)



Posted By: Wonderfulnews
Date Posted: 18-September-2012 at 6:35pm
Thanks for the easy to follow solution!


Posted By: Guests
Date Posted: 18-September-2012 at 7:14pm
Glad it worked for you.

Hopefully EI will add this to their next update.


Posted By: odathp
Date Posted: 02-December-2012 at 12:16am
Wow.  Thank you very much for this.  I am the original poster that reported this problem and have been dealing with it for at least a year.

This client is currently running PC 4.6a.  The two other locations you identified were never fixed.

Was just getting ready to post again to beg for a solution since we get 9-10 of these weird IPs a month and were potentially losing those orders.

Thanks again!!!!!!!!!!
+1 #" rel="nofollow - < id="ezPreviewPO" border="0" scrolling="yes" style="width: 100%; height: 90%">
  #" rel="nofollow - < id="ezPreview" border="0" scrolling="yes" style="width: 100%; height: 90%">


Posted By: Hamish
Date Posted: 02-December-2012 at 7:38am
Thanks Sean,
   I've added your fix to the system for the developers to pick up & incorporate.
Regards,
     Hamish


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net