1

I'm trying to setup MSSQL database on Linux - Debian 8.11 @ Virtualbox but I'm unable to connect to it via MSSQL MSSQL Server Management Studio

Server is pingable.

Reply from 192.168.56.101: bytes=32 time<1ms TTL=64
Reply from 192.168.56.101: bytes=32 time<1ms TTL=64
Reply from 192.168.56.101: bytes=32 time<1ms TTL=64 

Network settings in VirtualBox:

Host-only networking VirtualBox Host-Only Ethernet Adapter

Any ideas?

TITLE: Connect to Server
------------------------------

Cannot connect to 192.168.56.101.

------------------------------
ADDITIONAL INFORMATION:

The connection to the server was successfully established, but an error occurred during the login process.

(provider: SSL Provider, error: 0 - The existing connection was sharply closed by the remote host.)

(Microsoft SQL Server, Error: 10054)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10054&LinkId=20476

------------------------------

Connection Forcibly Closed by Remote Host
------------------------------
BUTTONS:

OK
------------------------------


Server Name: 192.168.56.101
Error Number: 10054
Severity: 20
State: 0


------------------------------
Program Location:

   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

Errors logs @ Server

https://pastebin.com/7WGEVg1a

2018-07-20 07:10:23.56 Server      Microsoft SQL Server 2017 (RTM-CU9) (KB4341265) - 14.0.3030.27 (X64) 

    Jun 29 2018 18:02:47 

    Copyright (C) 2017 Microsoft Corporation

    Developer Edition (64-bit) on Linux (Debian GNU/Linux 8 (jessie))

2018-07-20 07:10:23.57 Server      UTC adjustment: -4:00

2018-07-20 07:10:23.57 Server      (c) Microsoft Corporation.

2018-07-20 07:10:23.57 Server      All rights reserved.

2018-07-20 07:10:23.57 Server      Server process ID is 4120.

2018-07-20 07:10:23.57 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.

2018-07-20 07:10:23.57 Server      Registry startup parameters: 

     -d /var/opt/mssql/data/master.mdf

     -l /var/opt/mssql/data/mastlog.ldf

     -e /var/opt/mssql/log/errorlog

2018-07-20 07:10:23.58 Server      SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required.

2018-07-20 07:10:23.58 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.

2018-07-20 07:10:23.58 Server      Detected 1810 MB of RAM. This is an informational message; no user action is required.

2018-07-20 07:10:23.58 Server      Using conventional memory in the memory manager.

2018-07-20 07:10:23.69 Server      Buffer pool extension is already disabled. No action is necessary. 

2018-07-20 07:10:23.76 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.

2018-07-20 07:10:23.76 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.

2018-07-20 07:10:23.77 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are [....]

2018-07-20 07:10:23.80 Server      The maximum number of dedicated administrator connections for this instance is '1'

2018-07-20 07:10:23.80 Server      Node configuration: node 0: CPU mask: 0x0000000000000001:0 Active CPU mask: 0x0000000000000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.

2018-07-20 07:10:23.81 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.

2018-07-20 07:10:23.82 Server      In-Memory OLTP initialized on lowend machine.

2018-07-20 07:10:23.86 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.

2018-07-20 07:10:23.87 Server      Query Store settings initialized with enabled = 1, 

2018-07-20 07:10:23.87 spid6s      Starting up database 'master'.

2018-07-20 07:10:23.89 Server      Software Usage Metrics is disabled.

2018-07-20 07:10:24.22 spid6s      Resource governor reconfiguration succeeded.

2018-07-20 07:10:24.23 spid6s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.

2018-07-20 07:10:24.23 spid6s      SQL Server Audit has started the audits. This is an informational message. No user action is required.

2018-07-20 07:10:24.31 spid6s      SQL Trace ID 1 was started by login "sa".

2018-07-20 07:10:24.34 spid6s      Server name is 'debian'. This is an informational message only. No user action is required.

2018-07-20 07:10:24.37 spid22s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.

2018-07-20 07:10:24.38 spid9s      Starting up database 'mssqlsystemresource'.

2018-07-20 07:10:24.38 spid22s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.

2018-07-20 07:10:24.38 spid23s     Starting up database 'msdb'.

2018-07-20 07:10:24.38 spid9s      The resource database build version is 14.00.3030. This is an informational message only. No user action is required.

2018-07-20 07:10:24.39 spid24s     Starting up database 'debianIsAvaliable'.

2018-07-20 07:10:24.43 spid9s      Starting up database 'model'.

2018-07-20 07:10:24.83 spid24s     Parallel redo is started for database 'debianIsAvaliable' with worker pool size [1].

2018-07-20 07:10:24.94 spid9s      Polybase feature disabled.

2018-07-20 07:10:24.94 spid9s      Clearing tempdb database.

2018-07-20 07:10:24.98 spid6s      Parallel redo is shutdown for database 'debianIsAvaliable' with worker pool size [1].

2018-07-20 07:10:25.29 spid19s     A self-generated certificate was successfully loaded for encryption.

2018-07-20 07:10:25.31 spid19s     Server is listening on [ 'any' <ipv6> 1433].

2018-07-20 07:10:25.31 spid19s     Server is listening on [ 'any' <ipv4> 1433].

2018-07-20 07:10:25.32 Server      Server is listening on [ ::1 <ipv6> 1434].

2018-07-20 07:10:25.32 Server      Server is listening on [ 127.0.0.1 <ipv4> 1434].

2018-07-20 07:10:25.33 Server      Dedicated admin connection support was established for listening locally on port 1434.

2018-07-20 07:10:25.35 spid19s     SQL Server is now ready for client connections. This is an informational message; no user action is required.

2018-07-20 07:10:25.50 spid9s      Starting up database 'tempdb'.

2018-07-20 07:10:25.76 spid9s      The tempdb database has 1 data file(s).

2018-07-20 07:10:25.77 spid22s     The Service Broker endpoint is in disabled or stopped state.

2018-07-20 07:10:25.78 spid22s     The Database Mirroring endpoint is in disabled or stopped state.

2018-07-20 07:10:25.79 spid22s     Service Broker manager has started.

2018-07-20 07:10:25.80 spid6s      Recovery is complete. This is an informational message only. No user action is required.





Microsoft (R) SQLServerAgent 14.0.3030.27

Copyright (C) 2017 Microsoft Corporation. All rights reserved.



SQLAgent is disabled

SQLAgent is exiting


● mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled)
   Active: active (running) since Fri 2018-07-20 07:10:16 EDT; 9min ago
     Docs: https://learn.microsoft.com/en-us/sql/linux
 Main PID: 418 (sqlservr)
   CGroup: /system.slice/mssql-server.service
           ├─418 /opt/mssql/bin/sqlservr
           └─805 /opt/mssql/bin/sqlservr
UbuntuCore
  • 409
  • 7
  • 20
  • I *assume* the firewall ports are open? – Thom A Jul 20 '18 at 10:58
  • @Larnu Probably aren't. brb – UbuntuCore Jul 20 '18 at 10:59
  • *"The connection to the server was successfully established, but an error occurred during the login process"* - Implies the TCP connection worked so it's probably not a firewall issue. I would check the logs on the server, it may be an authentication issue. – Jonathon Reinhart Jul 20 '18 at 11:03
  • @Larnu I just "allowed TCP 1433 port" and still it doesn't work – UbuntuCore Jul 20 '18 at 11:05
  • Logs are located in `/var/opt/mssql/log/errorlog`. You'll need to be a superuser, or a member of the `mssql` group to access the directory. – Thom A Jul 20 '18 at 11:18
  • @JonathonReinhart Logs: https://pastebin.com/7WGEVg1a – UbuntuCore Jul 20 '18 at 11:21
  • I can't see any errors in there related to connecting. It might be worth opening UDP port 1434 as well. The logs imply it's listening on there too (which would be the browser service, however, I thought that wasn't supported on SQL Server on Linux) – Thom A Jul 20 '18 at 11:30
  • @Larnu Nothing changed, same error. – UbuntuCore Jul 20 '18 at 11:34
  • Are you able to connect locally via `sqlcmd`? Although the logs don't suggest it, the server isn't running in Single User Mode is it? (You should get a different error then, and something would be in the logs if thatw as the case, but just eliminating ideas.) – Thom A Jul 20 '18 at 11:37
  • https://pastebin.com/PCwVyxTP – UbuntuCore Jul 20 '18 at 11:47
  • @Larnu ``the server isn't running in Single User Mode is it?`` Not sure, I'mma check it. – UbuntuCore Jul 20 '18 at 11:49
  • @Larnu Even with ``2018-07-20 07:55:38.87 spid6s Warning ****************** 2018-07-20 07:55:38.87 spid6s SQL Server started in single-user mode. This an informational message only. No user action is required.`` I'm receiving the same error. – UbuntuCore Jul 20 '18 at 11:57
  • You don't want the server in Single User. I assume, as you didn't comment, that the local connection worked then? – Thom A Jul 20 '18 at 11:59
  • @Larnu Doesn't work in any of those ways: Single-user mode being enabled and disabled. Those are logs for attempts with or without single user mode. https://pastebin.com/9NASGZek – UbuntuCore Jul 20 '18 at 12:03
  • So you can't connect locally either via `sqlcmd`..? You still haven't answered that question. – Thom A Jul 20 '18 at 12:04
  • @Larnu Nope, I cannot. sqlcmd -S 192.168.56.101 -E Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SSL Provider: The existing connection was sharply closed by the remote host. Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Client unable to establish connection. – UbuntuCore Jul 20 '18 at 12:11

1 Answers1

1

Workaround:

Other probably helpful links:

Docker - Container is not running

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-2.1

https://github.com/aspnet/KestrelHttpServer/issues/1263

UbuntuCore
  • 409
  • 7
  • 20