Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The MARS TDS header contained errors connecting to Azure SQL Server #2886

Closed
Thorium opened this issue Sep 25, 2024 · 6 comments
Closed

The MARS TDS header contained errors connecting to Azure SQL Server #2886

Thorium opened this issue Sep 25, 2024 · 6 comments
Labels
👴 System.Data.SqlClient Issues that occur in System.Data.SqlClient only.

Comments

@Thorium
Copy link

Thorium commented Sep 25, 2024

I have an Microsoft .NET Framework 4.8 enterprise application running in Windows (10.0.17763.6189) and data stored on an Azure SQL database (Gen5, 12.0.2000.8).

Occasionally I get unrecoverable error stating: System.Data.SqlClient.SqlException (0x80131904): The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.

I'm using the System.Data.SqlClient 4.8.6
I have explicitly defined MultipleActiveResultSets=False in the connection string, but this still happens (not as often as without).

Possible duplicate of #85 which is closed even the issue still exists.

Stack trace:

System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__180_0(Task`1 result)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

I have not managed to reproduce the issue with a single development environment.

@Thorium Thorium changed the title The MARS TDS header contained errors using ASP.NET Core and EF Core connecting to Azure SQL Server The MARS TDS header contained errors connecting to Azure SQL Server Sep 25, 2024
@Thorium
Copy link
Author

Thorium commented Sep 25, 2024

Sorry the original title, no entity framework here, just plain old simple SQL-connection.

@ErikEJ
Copy link
Contributor

ErikEJ commented Sep 25, 2024

This repository is for Microsoft.Data.SqlClient, System.Data.SqlClient is out of mainstream support and will be deprecated soon.

@Thorium
Copy link
Author

Thorium commented Sep 25, 2024

System.Data.SqlClient will not be deprecated in .NET Framework, only in .NET 6/8.

It's part of .NET Framework, and the support of .NET Framework continues, probably as long as big banks exists.

@David-Engel
Copy link
Contributor

System.Data.SqlClient 4.8.6 indicates you are referencing the System.Data.SqlClient NuGet package (https://www.nuget.org/packages/System.Data.SqlClient/4.8.6) since .NET Framework is currently only versioned up to 4.8.1. That package is not part of .NET Framework and is deprecated.

Here's where it gets a little confusing. If your application targets .NET Framework and references that NuGet package, the package just forwards everything to System.Data.SqlClient (System.Data.dll) in .NET Framework.

I thought the MARS TDS header contained errors fixes were all backported to System.Data.SqlClient.

@cheenamalhotra - Do you remember if all the fixes were backported to SDS on netfx?

@cheenamalhotra
Copy link
Member

@David-Engel

Are you talking about #922 or #910?

Change in #910 already exists in .NET Framework System.Data, and in a .NET Framework 4.8 application, the app context switch MakeReadAsyncBlocking is enabled by default, so my assumption is this should mitigate the problem?

I don't see we took back the #922 change.

@arellegue arellegue added the 🆕 Triage Needed For new issues, not triaged yet. label Sep 27, 2024
@cheenamalhotra
Copy link
Member

@Thorium It's unlikely that System.Data.dll (.NET Framework) will be patched for this particular bug as the acceptance bar for backporting fixes to System.Data.dll is very high and only security bugs are backported since past few years now.

I would recommend migrating your application to use Microsoft.Data.SqlClient instead.

Are there any challenges you've seen when migrating to MDS? Please refer to porting-cheat-sheet for porting guidelines and let us know if you face any challenges or blockers when migrating.

@cheenamalhotra cheenamalhotra added 👴 System.Data.SqlClient Issues that occur in System.Data.SqlClient only. and removed 🆕 Triage Needed For new issues, not triaged yet. labels Oct 1, 2024
@cheenamalhotra cheenamalhotra closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👴 System.Data.SqlClient Issues that occur in System.Data.SqlClient only.
Projects
None yet
Development

No branches or pull requests

5 participants