Page 1 of 1

Error: String or binary data would be truncated : Solved

Posted: Wed Oct 15, 2008 1:03 pm
by heinscott
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

Re: Missing Orders and Error Log Entry

Posted: Wed Oct 15, 2008 1:07 pm
by Katie
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

Re: Missing Orders and Error Log Entry

Posted: Wed Oct 15, 2008 1:28 pm
by heinscott
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

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

Posted: Fri Oct 17, 2008 2:46 pm
by Tomgard
Even with the patch installed I am still having an issue.

Can the 255 be increased?

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

Posted: Fri Oct 17, 2008 3:01 pm
by Shopping Cart Admin
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);

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

Posted: Fri Oct 17, 2008 3:37 pm
by Tomgard
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.

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

Posted: Tue Oct 21, 2008 1:13 pm
by dittohead
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.

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

Posted: Mon Nov 03, 2008 1:18 pm
by Tomgard
We continue to have issues on this. Has a bug been reported?

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

Posted: Mon Nov 03, 2008 2:34 pm
by dittohead
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.

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

Posted: Mon Nov 03, 2008 3:25 pm
by Logan Rhodehamel
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?

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

Posted: Mon Nov 03, 2008 4:09 pm
by jmestep
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.