Situation:
MS-SQL Server <--> Local Network <-- VPN --> Google Kubernetes <--> Pod (sql-client)
- our local network is connected via VPN to our Google Kubernetes cluster
- the ms-sql server is running in our local network
- one pod tries to open one instance of this ms-sql server
Problem:
I'm not able to create a connection via tcp:IP\instance_name. I tried all possible variant forms of spelling (\, \, /, //, /, ...)
But if I try to connect via tcp:IP,PORT, it is working. At the moment I'm not able to configure the server to use a static port. This means I need a solution with the instance-name.
Error-messages
root@mssql-tools-598c45d8bb-8x744:/# sqlcmd -S tcp:10.10.1.123\\DEV -U user -P password -d my_db
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF]. .
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
root@mssql-tools-598c45d8bb-8x744:/# sqlcmd -S tcp:10.10.1.123\DEV -U user -P password -d my_db
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Note:
- We captured the network-traffic with wireshark. While trying the connection via instance-name, we are able to see that the client and the server exchange the port correctly. But after that the client sends a package with ACK: true and Fin: true (directly after that the connection is closed)
- The connection string works out of a windows-pc
- this is the container-image used for testing: https://hub.docker.com/_/microsoft-mssql-tools