logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
charles25686713  
#1 Posted : Monday, March 27, 2023 2:02:05 PM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi, I have three entries in the logs today that look like this:

---
An error has occured at /Admin/Orders/AuthorizePayment?paymentId=54722&X-Requested-With=XMLHttpRequest&_=1679769633467
Exception: String or binary data would be truncated. The statement has been terminated. Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(DbCommand cmd) at NHibernate.Id.IdentityGenerator.InsertSelectDelegate.ExecuteAndExtract(DbCommand insert, ISessionImplementor session) at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
---

I don't recall seeing this before.

Please advise,
Thanks.

EDIT: The number at the end of the first line differs across the entries.

Edited by user Monday, March 27, 2023 2:04:49 PM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

Katie S  
#2 Posted : Monday, March 27, 2023 8:23:17 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Generally, this error means that there was a field in the database that couldn't accommodate the length of the data to be inserted, so it was truncated.

Just the error alone doesn't give enough of a picture to see what data that is.

What payment processor are you using?

The Authorization request is where the error happens, so are you seeing orders with a failed payment?

You can enable the debug logging for the payment gateway. If it happens again, then we can look at the transaction logs and try to get some more information.



Thanks for your support!

Katie
Secure eCommerce Software and Hosting
charles25686713  
#3 Posted : Tuesday, March 28, 2023 10:47:39 AM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
We use Authorize.Net CIM.

The three entries are for the same payment id, which points to one order with a Visa payment for $1 that did complete.

Sometimes these smaller ones are processed offline, from AC's perspective. I can't tell if this one went through A.NET CIM or was offline.

Shouldn't there be another error recorded if the payment failed?

Can we get additional logging captured with errors, aside from the exception? As you aptly stated, not much info is shown in the error.

Also, if I read the exception correct, the transaction was not truncated; it was terminated:

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

Thanks,
Charles

Edited by user Tuesday, March 28, 2023 10:48:34 AM(UTC)  | Reason: Not specified

Katie S  
#4 Posted : Tuesday, March 28, 2023 2:08:04 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Yes, if you could enable the debug logging feature from the Authorize.net CIM configuration page at Configure > Payments > Gateways >>

If you look at the Order and go to the Payments tab, you should be able to see additional information about the transaction.

I'm not sure what you mean by "Sometimes these smaller ones are processed offline"

If you can explain the steps because it sounds like this was a payment processed through the admin side.

Thanks
Thanks for your support!

Katie
Secure eCommerce Software and Hosting
charles25686713  
#5 Posted : Tuesday, March 28, 2023 2:13:15 PM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi, it's complicated.

Suffice it to say we use AC for onsite transactions as well, which may or may not be with a card swiper directly through authorize.net, and then we record the transaction "offline" in AC.

I think one was one of those with a payment recorded offline.
Katie S  
#6 Posted : Tuesday, March 28, 2023 2:55:25 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
When you record an offline payment, AbleCommerce is not communicating with the payment gateway, so info for the transaction from the gateway logs isn't going to appear.

The error you posted indicates it is trying to authorize the payment instead of recording an offline payment.

An error has occured at /Admin/Orders/AuthorizePayment?paymentId=54722&


I was able to reproduce a similar error by posting an offline payment and adding too much text to the Reference field. But it appears in the log as this:

An error has occured at /Admin/Orders/RecordNewPayment

But the truncation error means that there is some data that is too long to be inserted in the database field. The termination error indicates the code was not executed.

When you Add New Payment from an existing order, there are two tabs:

Process Credit Card Payment - this will communicate with Authorize.net and process the payment within AbleCommerce
Record Offline Payment - this is where you can record a payment that was processed outside of AbleCommerce

Hope this helps.
Thanks for your support!

Katie
Secure eCommerce Software and Hosting
charles25686713  
#7 Posted : Tuesday, March 28, 2023 3:57:48 PM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Thanks for the followup.

I don't see Authorize.Net transaction data on the payment, so I think this was an "offline" one.

I'm reaching out to the onsite user who would have encountered the error to see what she says.

Charles
Users browsing this topic
Guest (4)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.