The create_databases script fails with Sqlcmd Error: Login timeout expired

The create_databases script fails with Sqlcmd Error: Login timeout expired

book

Article ID: KB0070386

calendar_today

Updated On:

Products Versions
Spotfire Server 14.2.0

Description

When running the create_databases.bat script on Windows, the following error is observed:
 

C:\scripts\mssql_install> create_databases.bat
Press CTRL+C to stop at any time

Connection identifier (e.g. 'SERVER\MSSQL_INSTANCENAME')
DBSERVER_CONNECTIDENTIFIER: mydbhost\myinstance

Database administrator username
DBSERVER_ADMIN_USERNAME [sa]: sa

Database administrator password (warning: password will be visible in clear)
DBSERVER_ADMIN_PASSWORD: ************

Name of the Spotfire server database to create
SPOTFIREDB_DBNAME [spotfire_server]: spotfire_server

Name of the Spotfire server database user to create
SPOTFIREDB_USERNAME: sfdbuser

Password for the Spotfire server database user (warning: password will be visible in clear)
SPOTFIREDB_PASSWORD: ************

You have supplied the following information:
DBSERVER_CONNECTIDENTIFIER:       mydbhost\myinstance
DBSERVER_ADMIN_USERNAME:          sa
DBSERVER_ADMIN_PASSWORD:          ********
SPOTFIREDB_DBNAME:                spotfire_server
SPOTFIREDB_USERNAME:              sfdbuser
SPOTFIREDB_PASSWORD:              ********

Would you like to use the above information to create the spotfire server database? [y/n]: y

Creating Spotfire Server tables

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [53]. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 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..

 

Environment

Windows

Resolution

These errors indicate that the database server is unreachable due to firewall rules, or that the value being supplied for DB_SERVER_CONNECTIDENTIFIER is incorrect. First, confirm that the database server machine can be reached over the expected port. By default, SQL Server uses port 1433, but you should confirm that with your database administrator. To check connectivity to the database port, you can use telnet or portqry on Windows. For example:
 
C:\scripts\mssql_install> telnet mydbhost 1433
C:\scripts\mssql_install> portqry -n mydbhost -p tcp -e 1433

Although the script hints that the value for DB_SERVER_CONNECTIDENTIFIER should be in the format 'SERVER\MSSQL_INSTANCENAME', this is often incorrect for newer versions of SQL Server.

Instead, use only the server name and do not include the SQL Server instance ID in the DB_SERVER_CONNECTIONIDENTIFIER. In the above example, the value should be changed from 'mydbhost\myinstance' to 'mydbhost'.

Note: If you are running the create_databases.bat script on the same machine where the SQL Server database is running, you may be able to use 'localhost' as the value. In some cases, it may be needed to supply the IP address of the machine instead of the host name or 'localhost'.

Issue/Introduction

Outlines some troubleshooting steps and suggestions to resolve timeout errors when running the create_databases.bat script on Windows.