ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Using ProductCart
  New Posts New Posts RSS Feed - Error -2147217833 IP Address would be truncated
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Error -2147217833 IP Address would be truncated

 Post Reply Post Reply Page  12>
Author
Message
odathp View Drop Down
Newbie
Newbie


Joined: 19-April-2010
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote odathp Quote  Post ReplyReply Direct Link To This Post Topic: Error -2147217833 IP Address would be truncated
    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.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post 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!? 
Back to Top
odathp View Drop Down
Newbie
Newbie


Joined: 19-April-2010
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote odathp Quote  Post ReplyReply Direct Link To This Post 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.


Our other customer that had this problem was listed on CBL, but has since been removed.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post 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!!    
Back to Top
odathp View Drop Down
Newbie
Newbie


Joined: 19-April-2010
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote odathp Quote  Post ReplyReply Direct Link To This Post 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")

Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post 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.  
Back to Top
Wonderfulnews View Drop Down
Newbie
Newbie


Joined: 15-July-2012
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wonderfulnews Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
Wonderfulnews View Drop Down
Newbie
Newbie


Joined: 15-July-2012
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wonderfulnews Quote  Post ReplyReply Direct Link To This Post Posted: 18-September-2012 at 6:35pm
Thanks for the easy to follow solution!
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 18-September-2012 at 7:14pm
Glad it worked for you.

Hopefully EI will add this to their next update.
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.