Open SergeyIlyinFirst opened 4 years ago
Seems like a duplicate of https://github.com/dotnet/SqlClient/issues/85
@cheenamalhotra
Hi @SergeyIlyinFirst
Yes, this is a known issue and is tracked under https://github.com/dotnet/SqlClient/issues/85.
If you have a .NET Framework application, please try enabling below app context switch and let us know. (helpful info shared by a customer in https://github.com/dotnet/SqlClient/pull/547#issuecomment-716055128)
AppContext.SetSwitch("Switch.System.Data.SqlClient.MakeReadAsyncBlocking", true);
@mairaw could you please transfer this issue to dotnet/SqlClient repository? Thanks!
Hi, We exactly get this error yesterday too, on a running .net core App in production with no particular reason... If you can help us we are using Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3"
Is there Something to update ou modify ? thanks David
Hi @novitito
Please reference Microsoft.Data.SqlClient v1.1.3 or v2.0.1+ in your application to get fix (PR #557 and PR #550) for same issue in .NET Core applications.
If you continue to encounter issue with the updated driver, please wrap a repro application with latest driver version and provide us in Issue #85 in dotnet/sqlclient repository.
@cheenamalhotra AppContext.SetSwitch("Switch.System.Data.SqlClient.MakeReadAsyncBlocking", true) - not help. The error is repeated.
@SergeyIlyinFirst
Let me clearly specify again as most information is in dotnet/sqlclient#85
For .NET Framework application:
If your application is using System.Data.SqlClient (.NET Framework), you need to use AppContext switch as under:
AppContext.SetSwitch("Switch.System.Data.SqlClient.MakeReadAsyncBlocking", true);
whereas if you're using Microsoft.Data.SqlClient (.NET Framework), you need to use this AppContext switch:
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.MakeReadAsyncBlocking", true);
(also set by default)
For .NET Core application:
Use System.Data.SqlClient v4.8.2, OR use Microsoft.Data.SqlClient v1.1.3 or above.
Could you please confirm what runtime your application is using and if trying above options are not working in your case?
I'm not sure I follow 🤔
@cheenamalhotra we tested our app on a single server. The results in the pictures. There are fewer errors, but they are there. Testing other servers. There are options for the fix? Errors before correction 158, after 25. It should be zero. https://yadi.sk/d/wwOkoYjNG7U7Gw
@cheenamalhotra {
"error": {
"message": "The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.",
"data": {
"Errors": [{
"Source": ".Net SqlClient Data Provider",
"Number": 4011,
"State": 3,
"Class": 16,
"Server": "sqlintao",
"Message": "The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.",
"Procedure": "",
"LineNumber": 1
}],
"ClientConnectionId": "3fe3fc23-7d95-4320-96b3-16be93d81567",
"ClassName": "System.Data.SqlClient.SqlException",
"Message": "The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.",
"Data": {
"HelpLink.ProdName": "Microsoft SQL Server",
"HelpLink.ProdVer": "13.00.5820",
"HelpLink.EvtSrc": "MSSQLServer",
"HelpLink.EvtID": "4011",
"HelpLink.BaseHelpUrl": "http://go.microsoft.com/fwlink",
"HelpLink.LinkId": "20476"
},
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at System.Data.SqlClient.SqlCommand.<>c.1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Dapper.SqlMapper.
We encounter an error from time to time: The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors. Tool versions: .net 4.8, sql server 13.0.5820.21. This problem is Microsoft. Data. SqlClient of all versions, and with System. Data. SqlClient 4.8.2. We tried all the solutions that are listed on the forums. Not help. Other developers also have this problem. Our users suffer from this. We sincerely ask you to pay attention to this problem as soon as possible and report a solution. Thanks!