Error: String or binary data would be truncated : Solved

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Error: String or binary data would be truncated : Solved

Post by heinscott » Wed Oct 15, 2008 1:03 pm

Hello. I'm hoping that someone has seen this error before, and could help me with it...

10/15/2008 10:20:27 AM Error Unhandled exception during checkout. String or binary data would be truncated. The statement has been terminated.

Today, I had three of these entries in my error log, and they seem to coincide with 3 skipped order numbers. Does anyone know what could have caused this problem? I'm worried that people are trying to order, and leaving after the order fails to process!

Thanks for any help you can give me!

Scott

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Missing Orders and Error Log Entry

Post by Katie » Wed Oct 15, 2008 1:07 pm

This is an issue that we identified and fixed in the upgrade from RC3 to Final. The necessary fix is in the global.asax file which does not get included on upgrading. Please make sure that you followed the post-upgrade instructions found here -

http://help.ablecommerce.com/upgrades/a ... _final.htm

The critical fixes on this page are -

Issue ID 6769 - Truncation error causing lost orders on checkout

Issue ID 6867 - Orders with missing customer information

Thanks,
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Missing Orders and Error Log Entry

Post by heinscott » Wed Oct 15, 2008 1:28 pm

Thank you Katie!

I found that I had performed the fix on my local copy, and then never made the changes to the server.
I appreciate your help so very much!

Scott

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Error: String or binary data would be truncated : Solved

Post by Tomgard » Fri Oct 17, 2008 2:46 pm

Even with the patch installed I am still having an issue.

Can the 255 be increased?
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Error: String or binary data would be truncated : Solved

Post by Shopping Cart Admin » Fri Oct 17, 2008 3:01 pm

Hello,

Perhaps this change wasn't added to the file (or the correct file), it will shorten the length to 255 so increasing the db field beyond 255 isn't needed.

1.

Change TO:

if (Request.UrlReferrer != null) Session["SessionReferrerUrl"] = StringHelper.Truncate(Request.UrlReferrer.ToString(), 255);
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Error: String or binary data would be truncated : Solved

Post by Tomgard » Fri Oct 17, 2008 3:37 pm

I have verified that I have the correct file keyed and even tried to replace the entire global.ascx file with the latest download from your site. I have actually been using the corrected file since 8/14 but just began having issues with this in the last 3 days. The problem appears to have something to do with paypal orders specifically but I can not be sure of this.
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: Error: String or binary data would be truncated : Solved

Post by dittohead » Tue Oct 21, 2008 1:13 pm

I have also verified that our store has the updated global.ascx, but we have received the same error message as mentioned above; however, we only process credit card orders.

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Error: String or binary data would be truncated : Solved

Post by Tomgard » Mon Nov 03, 2008 1:18 pm

We continue to have issues on this. Has a bug been reported?
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: Error: String or binary data would be truncated : Solved

Post by dittohead » Mon Nov 03, 2008 2:34 pm

I have finally resolved this issue. The problem lies with a product name that is greater than 100 characters. Modifying the product table resolved our problem. The following fields are limited to 100 characters: ThumbnailAltText, ImageAltText and IconAltText. These fields need to increased to match the product name field which stands at 255 characters. However, the basket may need to be cleared before these changes work.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Error: String or binary data would be truncated : Solved

Post by Logan Rhodehamel » Mon Nov 03, 2008 3:25 pm

The problem with field lengths in 7.0 is a discrepancy between what the tables allow for ac_Products, ac_BasketItems, and ac_OrderItems. The big one is the product name. ac_Products and ac_BasketItems allow 255 characters, but ac_OrderItems only allows 100. I am not sure how the thumbnail / alt text plays into the error you were receiving?

The short term workarounds are to make sure all products have names of 100 characters or less, or to manually edit the ac_OrderItems table to extend the name field size. Is this not consistent with what you found?
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Error: String or binary data would be truncated : Solved

Post by jmestep » Mon Nov 03, 2008 4:09 pm

Logan, I think there was a problem with the image stuff also because of the code that generates the alt tags automatically. I know some time in the past there was a post to change those to 255 characters also. I don't think it had to do with checkout though.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply