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

Cannot connect #14382

Closed
Simone-86828 opened this issue Feb 22, 2021 · 43 comments
Closed

Cannot connect #14382

Simone-86828 opened this issue Feb 22, 2021 · 43 comments

Comments

@Simone-86828
Copy link

We have written the needed data into your clipboard because it was too large to send. Please paste.
Issue Type: Bug

Since the upgrade to 1.26.0 I can no longer connect to any server. Downloaded again the 1.25.3 and it works just fine.
Any particular change or is this a bug?

Please the error message I get here below:
Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass47_0.<CreateReplaceConnectionContinuation>b__0(Task1 _)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<b__0>d.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ManagedBatchParser\ReliableConnection\ReliableSqlConnection.cs:line 314
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs:line 550
ClientConnectionId:00000000-0000-0000-0000-000000000000

Here is the about screen:
Version: 1.26.0
Commit: 995095f
Date: 2021-02-19T03:24:52.069Z
VS Code: 1.48.0
Electron: 9.4.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

Azure Data Studio version: azuredatastudio 1.26.0 (995095f, 2021-02-19T03:24:52.069Z)
OS version: Darwin x64 19.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz (8 x 1400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 6, 6
Memory (System) 8.00GB (0.13GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (8)
Extension Author (truncated) Version
admin-pack Mic 0.0.2
admin-tool-ext-win Mic 0.0.2
agent Mic 0.48.0
dacpac Mic 1.6.0
import Mic 1.2.0
profiler Mic 0.11.0
server-report Mic 0.2.3
whoisactive Mic 0.1.4
@github-actions
Copy link

We need more info to debug your particular issue. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.

There are two types of logs to collect:

Console Logs

  • Open Developer Tools (Help -> Toggle Developer Tools)
  • Click the Console tab
  • Click in the log area and select all text (CTRL+A)
  • Save this text into a file named console.log and attach it to this issue.

Application Logs

  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • This will open the log folder locally. Please zip up this folder and attach it to the issue.

@Charles-Gagnon
Copy link
Contributor

Also - what type of server are you connecting to? SQL On-Prem (remote or localhost)/Azure/etc.

@Simone-86828
Copy link
Author

Hello,
please find the requested logs attached.
I'm trying to connect to 4 different instances of on-prem SQL sry 2014 std.
Running Azure Data Studio on macOS Catalina (10.15.7), while SQL instances are on 3 different server VMs, all running Windows 2012 R2.
Any other info you need please ask.
Thank you

Best regards

Console.log
20210222T195702.zip

@kburtram
Copy link
Member

@Simone-86828 we update the SqlClient driver in this build, which always has possibility for regressions/side-effects. Though we aren't seeing wide-spread connectivity problems related to the upgrade yet this morning. The error is indicating a network related problem accessing the server.

Have you ruled out that there may have been an intermittent network issue to these servers at the time you tested the new build (I assume this isn't the problem, but I'm not seeing anything to really go on with this issue yet)? e.g. if you had time I wonder if trying to upgrade again to see if the problem persists.

@juls858
Copy link

juls858 commented Feb 22, 2021

@kburtram
I'm having the same issue. I reported it here:
#14388

@kburtram
Copy link
Member

@mas-dse-juremigi thanks for confirming! Let's close the other issue as a duplicate and track the issue here.

@kburtram
Copy link
Member

@mas-dse-juremigi are you also using a mac client? can you provide any additional info about the servers you're connecting to? is there anything interesting in the logs (besides the exception callstack) that could help determine what's happening here.

@Code-DJ
Copy link

Code-DJ commented Feb 22, 2021

@kburtram I am using mac client. I also get a connectivity error using Windows Authentication. It says run kinit but when I run it, it has no impact. Goes back to showing the following error:

Connection failed due to Kerberos error.
Help configuring Kerberos is available at https://aka.ms/sqlopskerberos
If you have previously connected you may need to re-run kinit.

### Details:

Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication.
ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error -  An unsupported mechanism was requested (unknown mech-code 0 for mech unknown).
   at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed)
   at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags)
   at Microsoft.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName)
   at Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer)
   at Microsoft.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.SSPIError(String error, String procedure)
   at Microsoft.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
   at Microsoft.Data.SqlClient.TdsParser.SSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
   at Microsoft.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec, FeatureExtension requestedFeatures, SessionData recoverySessionData, Nullable`1 fedAuthFeatureExtensionData)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.Login(ServerInfo server, TimeoutTimer timeout, String newPassword, SecureString newSecurePassword)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass47_0.<CreateReplaceConnectionContinuation>b__0(Task`1 _)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<<OpenAsync>b__0>d.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ManagedBatchParser\ReliableConnection\ReliableSqlConnection.cs:line 314
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs:line 550
ClientConnectionId:dafb7f1c-dc64-44b5-91b3-578734a9c5d0

@kburtram
Copy link
Member

@Code-DJ it likes a different issue than the other ones. But could also be related to the driver bump (though we did specifically test windows auth on mac, there were some changes in the driver in this area). Just to connections are working fine on 1.25.3 and broke with today's update?

@Code-DJ
Copy link

Code-DJ commented Feb 22, 2021

@kburtram yes, it was working on 1.25.3 and then broke on 1.26. Also, when I compare the SqlException in my note to @Simone-86828 first note, it looks the same. Checked again. Looks different.

@Charles-Gagnon
Copy link
Contributor

@Code-DJ What type of server are you trying to connect to? On-Prem/Azure/etc?

@Code-DJ
Copy link

Code-DJ commented Feb 22, 2021

@Charles-Gagnon On-Prem SQL Server 2019.

@cssuh
Copy link
Member

cssuh commented Feb 22, 2021

@Code-DJ are you trying to run kinit through ADS or through Terminal?

@Code-DJ
Copy link

Code-DJ commented Feb 22, 2021

@cssuh through Terminal on ADS. Just tried it through iTerm2, same issue.

@cssuh
Copy link
Member

cssuh commented Feb 22, 2021

after running kinit, does it give any messages? Also, after running kinit, if you run klist, do you get a message containing the credentials issued and expire date?

@juls858
Copy link

juls858 commented Feb 22, 2021

@kburtram Yes, I am using a Mac. I am using On-Prem SQL Servers. kinit works without issue as I can authenticate with other services. I have no issue connecting to the same sql servers using python, pyodbc + latest version of Microsoft ODBC drivers (which also authenticate using kerberos). Only Azure Data Studio is having issues.

@Code-DJ
Copy link

Code-DJ commented Feb 22, 2021

@cssuh

kinit does not throw any errors. klist shows the following output:

Credentials cache: API:983E4737-ED75-4D12-8323-A20D9CAEE53C
        Principal: username@DOMAIN.COM

  Issued                Expires               Principal
Feb 22 16:14:26 2021  Feb 23 02:14:26 2021  krbtgt/DOMAIN.COM@DOMAIN.COM

@kburtram
Copy link
Member

I created a test build that is the same as the 1.26.0 release, except that it contains the SqlClient 2.0.0 driver instead of the upgraded driver. If anyone experiencing connectivity problems with 1.26.0 could please try one of the below builds to see if that resolves the problem. This will help isolate the source of the issue. Thanks!

macOS - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-macos-1.26.0-driver.zip
Windows ZIP - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-windows-1.26.0-driver.zip
Windows User Setup - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-windows-user-1.26.0-driver.exe
Windows System Setup - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-windows-system-1.26.0-driver.exe
Linux TAR.GZ - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-linux-1.26.0-driver.tar.gz
Linux RPM - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-linux-1.26.0-driver.rpm
Linux DEB - https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-linux-1.26.0-driver.deb

@Code-DJ
Copy link

Code-DJ commented Feb 23, 2021

@kburtram I have verified the macOS zip file. It works fine.

BTW, on Windows I don't have any issues with 1.26 Stable build, it connects fine using Windows Authentication.

@Simone-86828
Copy link
Author

Simone-86828 commented Feb 23, 2021

I confirm it works fine as well.

As for what suggested on yesterday about possible network problems, I tend to exclude them. I can have 1.25.3 and 1.26.0 running at same time, one connects and the other doesn't.

@kburtram
Copy link
Member

@Code-DJ @Simone-86828 thanks for confirming!

@Code-DJ
Copy link

Code-DJ commented Feb 23, 2021

@kburtram is this dotnet/SqlClient#848 included in the upgraded Client version for ADS?

@Charles-Gagnon
Copy link
Contributor

It is - we were using the latest 2.1.1 release which contains that fix.

https://github.com/dotnet/SqlClient/releases/tag/v2.1.1

@Charles-Gagnon
Copy link
Contributor

@Code-DJ @Simone-86828

The SqlClient team said that this might be because of a known issue - dotnet/SqlClient#868

Can you confirm whether you are attempting to connect to a non-default instance?

@Code-DJ
Copy link

Code-DJ commented Feb 23, 2021

@Charles-Gagnon I am connecting to a default instance. Here's one of the connections in the settings.json

{
    "options": {
        "server": "SERVERNAME",
        "database": "",
        "authenticationType": "Integrated",
        "user": "",
        "password": "",
        "applicationName": "azdata",
        "groupId": "6a44bfa1-a786-4cb9-93bd-e55a09b456c7",
        "databaseDisplayName": ""
    },
    "groupId": "6a44bfa1-a786-4cb9-93bd-e55a09b456c7",
    "providerName": "MSSQL",
    "savePassword": true,
    "id": "e33d6b64-68b7-45db-91ed-dfc98ff7010e"
},

I tried 2.1.1 with a .net project and the following connection string and get kerberos error. Don't get the error with 2.0.1

data source=SERVERNAME;initial catalog=DATABASENAME;trusted_connection=true

@Charles-Gagnon
Copy link
Contributor

Would you mind opening an issue in the SqlClient repo with that information? We can track further progress on the issue there.

@karinazhou
Copy link
Member

Hi @Code-DJ , please feel free to create an issue in dotnet/sqlclient so we can look further into it.

@Code-DJ
Copy link

Code-DJ commented Feb 23, 2021

@Code-DJ
Copy link

Code-DJ commented Feb 23, 2021

See dotnet/SqlClient#926 (comment) for the fix. 2.1.1 changed the way it checks for SPN. It now includes the default port number in the name, so you have to include the default port number (1433) when setting the SPN.

@Charles-Gagnon
Copy link
Contributor

Thanks @Code-DJ for following up with this!

@Simone-86828 @mas-dse-juremigi Could you see if their suggested fix helps you out as well?

@juls858
Copy link

juls858 commented Feb 24, 2021

@Charles-Gagnon I cannot test this as I don't manage our sql servers.

@Charles-Gagnon
Copy link
Contributor

Are you using SQL auth or Integrated auth through kerberos?

@juls858
Copy link

juls858 commented Feb 24, 2021

@Charles-Gagnon I am using integrated through kerberos

@Code-DJ
Copy link

Code-DJ commented Feb 24, 2021

Folks, I have reopened dotnet/SqlClient#926

@Simone-86828
Copy link
Author

Hello everybody,
I'm connecting to named instances. I tried including the port number (with this syntax: server\instance:port) but I got the same error.
Auth is integrated through kerberos for me as well.

@Sab3rRid3r
Copy link

Sab3rRid3r commented Feb 24, 2021

Identical situation here on macOS Catalina. Establishing a connection to a SQL server installed on another system / VM via instance like 'servername\instance' is no longer possible since version 1.26.0.

Test Build https://azuredatastudiobuilds.blob.core.windows.net/test/1.26.0/azuredatastudio-macos-1.26.0-driver.zip is working!

@jparadis2
Copy link

Same issue for me. Also happened when upgrading to 1.25.0 below was the ticket for that one:
#13751

@karinazhou
Copy link
Member

Hi,

If you are connecting with named instances that have \ in the server name, this will fail on Linux due to one of the changes we made in Microsoft.Data.SqlClient v2.1.0-preview2. The hot fix for this will be out soon.

If you are using the default instances, that is related to the SPN generation change in the driver. We are currently working on the fix.

Thanks,

@Charles-Gagnon
Copy link
Contributor

We'll be releasing a hotfix to roll back the driver change to unblock folks hitting this with ADS.

But for anyone running into this issue it would be helpful if you could go over to dotnet/SqlClient#926 and comment there to try and track down this issue so that we're able to update to the new driver version in the future without breaking everyone again 😄

@kburtram
Copy link
Member

Update 1.26.1 is available that rolls back the SQL Client driver. Please let us know if there are still connectivity issues with the latest build.

@kburtram kburtram unpinned this issue Feb 26, 2021
@Code-DJ
Copy link

Code-DJ commented Feb 27, 2021

@kburtram @Charles-Gagnon FYI, the issue is resolved in SqlClient dotnet/SqlClient#926

@kburtram
Copy link
Member

@Code-DJ thanks for the update! I'm not sure the exact plans for trying the driver update again at the moment. The last two releases required hotfixing a driver rollback, so we may wait a little to try to avoid pulling in additional regressions next month. I believe there are some fixes for AlwaysEncrypted Secure Enclaves we're trying to pickup with the driver update.

@fatal1010
Copy link

I know this is closed, but I am a new user of ADS and am getting the same error as @Code-DJ is above...I am on version 1.26.1 on macOS Catalina 10.15.7.

The difference is, I am able to connect to 1 server (the first server I tried, for some reason, no idea why others don't connect, no difference in other servers, slight minor version difference, same AD credentials, work's without issue on windows using SSMS for example), but none others. After running kinit and then klist inside ADS terminal I see my credentials and expiration date.

These are on-prem SQL Server instances.

Any assistance would be helpful.

Thanks

Credentials cache: API:31ED75AF-9125-4C5A-8B62-AE4CF9EA0D38
        Principal: username@MYDOMAIN.COM

  Issued                Expires               Principal
Mar  1 13:57:35 2021  Mar  1 23:57:28 2021  krbtgt/MYDOMAIN.COM@MYDOMAIN.COM
Version: 1.26.1
Commit: 796abbdf5fdd341e3528e30a6b777c93e115eb02
Date: 2021-02-24T23:37:01.966Z
VS Code: 1.48.0
Electron: 9.4.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

ERR Kerberos connection failure. Message : Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication. ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error - An unsupported mechanism was requested (unknown mech-code 0 for mech unknown). at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed) at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags) at Microsoft.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName) at Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer) at Microsoft.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength) Message Details : Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication. ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error - An unsupported mechanism was requested (unknown mech-code 0 for mech unknown). at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed) at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags) at Microsoft.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName) at Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer) at Microsoft.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.SSPIError(String error, String procedure)
at Microsoft.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
at Microsoft.Data.SqlClient.TdsParser.SSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
at Microsoft.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec, FeatureExtension requestedFeatures, SessionData recoverySessionData, Nullable1 fedAuthFeatureExtensionData) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.Login(ServerInfo server, TimeoutTimer timeout, String newPassword, SecureString newSecurePassword) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass45_0.<TryGetConnection>b__1(Task1 _)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location where exception was thrown --- at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<<OpenAsync>b__0>d.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ManagedBatchParser\ReliableConnection\ReliableSqlConnection.cs:line 314 --- End of stack trace from previous location where exception was thrown --- at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs:line 550 ClientConnectionId:3097f4fb-6034-47b0-a912-d81f9774dd80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants