Error downloading ordered digital assets

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Claudio
Ensign (ENS)
Ensign (ENS)
Posts: 9
Joined: Mon Jun 29, 2009 5:53 pm

Error downloading ordered digital assets

Post by Claudio » Fri Jul 10, 2009 6:39 pm

I receive the following SQL error when downloading ordered digital assets:

String or binary data would be truncated. The statement has been terminated.

The stack trace is:

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command) at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command) at CommerceBuilder.Data.Database.ExecuteScalar(DbCommand command) at CommerceBuilder.DigitalDelivery.Download.Save() at CommerceBuilder.Common.PersistentCollection`1.Save() at CommerceBuilder.Orders.OrderItemDigitalGood.SaveChildren() at CommerceBuilder.Orders.OrderItemDigitalGood.Save() at CommerceBuilder.Orders.OrderItemDigitalGood.RecordDownload(String remoteIP, String userAgent, String referrer) at Download.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Creating/setting up the store/digital assets and product all works fine. Ordering the product, capturing the payment, and fulfilling the download license all works. The customer can log into their account/recent order, and see the ordered digital goods. But the moment you click the link to do the download, the server error occurs, and the download cannot start. This occurs with digital products of any size, even ones 1k in size. This is on a test store on our internal evaluation network. Any help would be appreciated.

This is on Windows 2008 Enterprise, SQL Server 2008 Standard Edition. Network Service, which the online store is running under, has ddladmin, securityadmin, accessadmin, datareader, datawriter, public roles in the database. Web server and SQL server are on the same machine. Client is a remote Windows XP machine with IE8.

Claudio Friederich
CICClaudio@aol.com

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

Re: Error downloading ordered digital assets

Post by Logan Rhodehamel » Fri Jul 10, 2009 8:33 pm

Claudio wrote:OrderItemDigitalGood.RecordDownload(String remoteIP, String userAgent, String referrer)
Either the remote IP is too long (client is IPv6?), the user agent is too long (installed .NET framework betas, etc.), or the referrer is too long (least likely).

These problems most often happen on internal networks (particularly IPv6). You could open up your database and manipulate the structure of the ac_Downloads table. Extend the field sizes for the three fields and you will probably solve the problem.
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.

Claudio
Ensign (ENS)
Ensign (ENS)
Posts: 9
Joined: Mon Jun 29, 2009 5:53 pm

Re: Error downloading ordered digital assets

Post by Claudio » Mon Jul 13, 2009 3:02 pm

Increasing the size of the user agent fixed it. As such, I was able to see the user agent that went in. It was slightly longer than the 255 size:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)

As it reflects perfectly normal software (mainstream Office components, several .NET framework versions, etc.) in a future version of AbleCommerce you should definitely increase the sizes of the User Agent field(s) in your database to accommodate such values. A customer cannot be prevented from using a store because they have much internet related software or versions installed, and a consequent larger user agent. For now however, manually fixing the size will be fine for our purposes. So my question: suppose we did, in a production environment, increase the size of this field to guarantee our downloads will work. Would that cause future upgrades to fail, due to the database being structurally dissimilar from the normal AbleCommerce database? If additions to the database schema are needed by future versions, will the new versions be able to update the database, even if that field has been manually resized? If these are ok, then we should have no problems moving forward. Thanks.

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

Re: Error downloading ordered digital assets

Post by Logan Rhodehamel » Mon Jul 13, 2009 4:04 pm

It should not be a problem for future upgrades if you manually extend this field.
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.

Post Reply