You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If "Failover Partner" is set in the connection string sql client fails with null reference error
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Data.SqlClient
StackTrace:
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginWithFailover(Boolean useFailoverHost, ServerInfo primaryServerInfo, String failoverHost, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) in D:\Projects\SqlClient\src\Microsoft.Data.SqlClient\netcore\src\Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs:line 1654
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) in D:\Projects\SqlClient\src\Microsoft.Data.SqlClient\netcore\src\Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs:line 1299
This exception was originally thrown at this call stack:
Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginWithFailover(bool, Microsoft.Data.SqlClient.ServerInfo, string, string, System.Security.SecureString, bool, Microsoft.Data.SqlClient.SqlConnectionString, Microsoft.Data.SqlClient.SqlCredential, Microsoft.Data.ProviderBase.TimeoutTimer) in SqlInternalConnectionTds.cs
Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(Microsoft.Data.ProviderBase.TimeoutTimer, Microsoft.Data.SqlClient.SqlConnectionString, Microsoft.Data.SqlClient.SqlCredential, string, System.Security.SecureString, bool) in SqlInternalConnectionTds.cs
Looking at the source code RoutingInfo is being used when it is null.
To reproduce
Set failover partner in the connection string
Using sql server 2012, don't know if that has any affect
Expected behavior
Connect to sql server
Further technical details
Current source
.NET target: DotCore 3.1
SQL Server version: SQL Server 2012
Operating system: Windows 10
The text was updated successfully, but these errors were encountered:
Thank you @gunnarif for informing us.
Also, there is another issue related to failoverpartner is under investigation at #583
It is reproducible in Netcore with the following details, And NetFx does not reproduce it.
ManagedSNI: false/true
NetCore 3.1.4
Microsoft SQL Server 2017 (RTM-GDR) (KB4505224) - 14.0.2027.2 (X64) Jun 15 2019 00:26:19 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows 8.1 Enterprise 6.3 <X64> (Build 9600: ) (Hypervisor)
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.18362 N/A Build 18362
If "Failover Partner" is set in the connection string sql client fails with null reference error
Looking at the source code RoutingInfo is being used when it is null.
To reproduce
Set failover partner in the connection string
Using sql server 2012, don't know if that has any affect
Expected behavior
Connect to sql server
Further technical details
Current source
.NET target: DotCore 3.1
SQL Server version: SQL Server 2012
Operating system: Windows 10
The text was updated successfully, but these errors were encountered: