microsoft / vscode-mssql

Visual Studio Code SQL Server extension.
Other
1.55k stars 458 forks source link

Can't connect to any SQL Server since 1.1 Update #954

Closed gavdraper closed 7 years ago

gavdraper commented 7 years ago

I've just updated to version 1.1 of the extension and none of my connections work anymore.

Not sure how I get the full error but this is the what happens when I use any connection that was working right before I updated...

screen shot 2017-07-19 at 13 58 28

If I try to recreate the extension that also fails with this..

screen shot 2017-07-19 at 14 03 48

All connections are using SQL Auth. I've tried several servers I had setup from before the update and they all fail. They are a mix of SQL Server 2016 and 2017.

If you need more info let me know how to get it and I'll update this.

kevcunnane commented 7 years ago

@gavdraper sorry to hear this. Can you confirm you're on High Sierra (10.13)? We have updated to .Net Core 2.0, and I wonder if this might be some interaction with the new macOS version and .Net Core 2.0 support. I'll try updating my personal macbook to test this out, but could you help with the following:

If you could send on the full error trace that would be great. Thanks!

gavdraper commented 7 years ago

I can confirm I'm running High Sierra 10.13.

The error from the output window is...

[5:22:29 PM] Connecting to server "localhost" on document "untitled:Untitled-2". [5:22:30 PM] Error connecting to server "localhost". Details: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl/tls) handshake failed)

The full output of the log file is...

07/19/2017 17:21:55 [NORMAL] - Method "Initialize" at line 126 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Utility\Logger.cs

Initializing SQL Tools Service Host logger
07/19/2017 17:21:55 [NORMAL] - Method "Main" at line 41 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Program.cs

    Starting SQL Tools Service Host

07/19/2017 17:21:56 [VERBOSE] - Method "InitializeService" at line 57 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\TaskServices\TaskService.cs

    TaskService initialized

07/19/2017 17:21:56 [VERBOSE] - Method "InitializeService" at line 105 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\ObjectExplorer\ObjectExplorerService.cs

    ObjectExplorer service initialized

07/19/2017 17:21:56 [VERBOSE] - Method "InitializeService" at line 42 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs

    TSqlFormatter initialized

07/19/2017 17:21:56 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Request] and method[initialize]

07/19/2017 17:21:57 [VERBOSE] - Method "InitializeService" at line 135 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    Initializing workspace service

07/19/2017 17:21:57 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Response] and method[initialize]

07/19/2017 17:21:57 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[$/setTraceNotification]

07/19/2017 17:21:57 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[workspace/didChangeConfiguration]

07/19/2017 17:21:57 [VERBOSE] - Method "HandleDidChangeConfigurationNotification" at line 323 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidChangeConfigurationNotification

07/19/2017 17:21:57 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[textDocument/didOpen]

07/19/2017 17:21:57 [VERBOSE] - Method "HandleDidOpenTextDocumentNotification" at line 250 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidOpenTextDocumentNotification

07/19/2017 17:21:57 [VERBOSE] - Method "ResolveFilePath" at line 163 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Resolved path: untitled:Untitled-1

07/19/2017 17:21:57 [VERBOSE] - Method "GetFileBuffer" at line 211 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Opened file as in-memory buffer: untitled:Untitled-1

07/19/2017 17:21:57 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Request] and method[version]

07/19/2017 17:21:57 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Response] and method[version]

07/19/2017 17:21:58 [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1584 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs

    Analyzing script file: untitled:Untitled-1

07/19/2017 17:21:59 [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1586 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs

    Analysis complete.

07/19/2017 17:21:59 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Event] and method[textDocument/publishDiagnostics]

07/19/2017 17:22:03 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[textDocument/didOpen]

07/19/2017 17:22:03 [VERBOSE] - Method "HandleDidOpenTextDocumentNotification" at line 250 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidOpenTextDocumentNotification

07/19/2017 17:22:03 [VERBOSE] - Method "ResolveFilePath" at line 163 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Resolved path: untitled:Untitled-2

07/19/2017 17:22:03 [VERBOSE] - Method "GetFileBuffer" at line 211 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Opened file as in-memory buffer: untitled:Untitled-2

07/19/2017 17:22:04 [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1584 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs

    Analyzing script file: untitled:Untitled-2

07/19/2017 17:22:04 [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1586 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs

    Analysis complete.

07/19/2017 17:22:04 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Event] and method[textDocument/publishDiagnostics]

07/19/2017 17:22:04 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[textDocument/didClose]

07/19/2017 17:22:04 [VERBOSE] - Method "HandleDidCloseTextDocumentNotification" at line 284 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidCloseTextDocumentNotification

07/19/2017 17:22:04 [VERBOSE] - Method "ResolveFilePath" at line 163 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Resolved path: untitled:Untitled-2

07/19/2017 17:22:09 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[textDocument/didOpen]

07/19/2017 17:22:09 [VERBOSE] - Method "HandleDidOpenTextDocumentNotification" at line 250 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidOpenTextDocumentNotification

07/19/2017 17:22:09 [VERBOSE] - Method "ResolveFilePath" at line 163 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Resolved path: untitled:Untitled-2

07/19/2017 17:22:09 [VERBOSE] - Method "GetFileBuffer" at line 211 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs

    Opened file as in-memory buffer: untitled:Untitled-2

07/19/2017 17:22:09 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Event] and method[textDocument/didChange]

07/19/2017 17:22:09 [VERBOSE] - Method "HandleDidChangeTextDocumentNotification" at line 230 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs

    HandleDidChangeTextDocumentNotification

07/19/2017 17:22:29 [VERBOSE] - Method "ListenForMessages" at line 249 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs

    Received message of type[Request] and method[connection/connect]

07/19/2017 17:22:29 [VERBOSE] - Method "HandleConnectRequest" at line 741 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs

    HandleConnectRequest

07/19/2017 17:22:29 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Response] and method[connection/connect]

07/19/2017 17:22:30 [VERBOSE] - Method "WriteMessage" at line 63 of C:\J\jobs\sqltoolsservice_master_win\workspace\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageWriter.cs

    Sending message of type[Event] and method[connection/complete]
kevcunnane commented 7 years ago

OK, last question for now: do you have any other version of "dotnet" e.g. the SDK on your mac? Trying to narrow down the possibilities - while ours is a standalone dotnet install it's always possible something is using a global component and that's causing problems.

I'm installing High Sierra and will try to repro on that machine once it's done.

gavdraper commented 7 years ago

I have the version 1.0.1 of the core SDK installed. screen shot 2017-07-19 at 21 33 48

kevcunnane commented 7 years ago

OK, I can reproduce this on High Sierra without dotnet core 2.0 installed. I'll next try installing that as a workaround (and also so I can see about creating a repro to open this in the corefx repository, since it's cleaner if I do it using a simple app that creates a new SqlConnection and tries to connect).

kevcunnane commented 7 years ago

@gavdraper I've created an issue in the corefx repo for this. Looking at https://github.com/dotnet/announcements/issues/22, it seems there are a bunch of known SSL issues that the dotnet team has reported to Apple. It's possible that any fix will be on Apple's side and have to be included in an update of High Sierra itself.

For a bit of background, .Net moved from using OpenSSL on Mac to using Apple's built-in SSL provider. This works great on Sierra but looks like there are regressions / changes in High Sierra that block this.

gavdraper commented 7 years ago

Great I’ll follow that issue. Thanks for the help.

gavdraper commented 7 years ago

For anyone else having this issue who don't want to downgrade macOS, installing version 1.0.0 of the extension will get the mssql extension working again.

kevcunnane commented 7 years ago

An update on this - the bug is already fixed in .Net Core 2.0 Preview 3 daily builds. When that's released we'll need to update our extension and re-release. I'll leave this open to track it until then.