Using other instance-name than default on MS SQL server fails

I'm trying to setup TeamCity on Windows (TeamCity-8.1.4.exe) and run on MS Sql Server but I have trouble connecting to the correct database. The database is created on our sql-server on an instance other than the default instance. However, nomatter what i type in the settings, it will NOT connect to anything other than the default instance of our sql-server. What am I doing wrong?

It all started during the web-based installation where I should setup database connection. In no way would it respect my named instance name - always returned login-error. After checking everything multiple times, including connecting (sucessfully) to the database from elsewhere using SSMS, I finally gave up, and created the database on the default instance, where it connected without any problems.

After having TeamCity up and running (on the default instance of sql-server, which is not wanted), I am now trying to edit the database configuration file (d:\TeamCityData\config\database.properties), to suit my needs by letting it connect to my named instance of SQL-server, but I have no luck.

According to http://confluence.jetbrains.com/display/TCD8/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer this should be the configuration that would work:

connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionUrl=jdbc:sqlserver://sql.mydomain.com\\mycustominstance:1433;databaseName=dbTeamCity

However, it doesn't. It always connects to the default instance of the sql-server.
I have tried several other ways/formats of the connection string, but everything gives the same result.

connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionUrl=jdbc:sqlserver://sql.mydomain.com\\mycustominstance:1433;instance=mycustominstance;databaseName=dbTeamCity


connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionProperties.instance=mycustominstance

connectionUrl=jdbc:sqlserver://sql.mydomain.com\\mycustominstance:1433;databaseName=dbTeamCity


connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionProperties.instance=mycustominstance

connectionUrl=jdbc:sqlserver://sql.mydomain.com:1433;databaseName=dbTeamCity


connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionProperties.instance=mycustominstance

connectionUrl=jdbc:sqlserver://sql.mydomain.com\\mycustominstance:1433;instance=mycustominstance;databaseName=dbTeamCity

I have tried editing the servername, and then the connection fails, so TeamCity IS using this string to connect to the database. I have restarted the TeamCity server during every edit of the config-file.

Can anyone spot what I'm droing wrong or have I found a bug?

6 comments
Comment actions Permalink

Hi,

Could you please attach teamcity-server.log? Probably there are some exceptions which can help to locate the cause of the problem.

0
Comment actions Permalink

Hi Alina and thank you for your quick reply.

I just figured it out moments ago. I had to remove the port-number from the connection string, and now it works.

So my config is now this:

connectionProperties.user=teamcity

connectionProperties.password=supersecretpassword

connectionUrl=jdbc:sqlserver://sql.mydomain.com\\mycustominstance;databaseName=dbTeamCity

The explicitly defined port-number apparently confuses either TeamCity or SQL server (2008) when using named instances - TeamCity connects to the default instance no matter what named instance you have specified, if the port-number is supplied.

However, I'm 99% sure that during my initial installation/setup of TeamCity - in the webbased step where Database properties should be supplied (one of the first) - it didn't make a difference whether I used port-number or not (eg. sql.mydomain.com or sql.mydomain.com:1433).

I think that maybe TeamCity explicitly appends the default sql port-number (1433), behind the scenes, to the connection string if the user doesn't supply it during the setup and this is what gives the unexpected results?

0
Comment actions Permalink

Below is the beginning of my TeamCity server log:

[2014-08-06 09:59:49,419]   INFO -  jetbrains.buildServer.STARTUP -

[2014-08-06 09:59:49,419]   INFO -  jetbrains.buildServer.STARTUP - ===========================================================

[2014-08-06 09:59:49,419]   INFO -  jetbrains.buildServer.STARTUP - Starting TeamCity server

[2014-08-06 09:59:53,241]   INFO -  jetbrains.buildServer.STARTUP - TeamCity version: 8.1.4 (build 30168), data format version 658

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - OS: Windows Server 2008 R2, User: WEBDEPLOY$, JRE: 1.7.0_51-b13 Java HotSpot(TM) Server VM (32 bit)

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - JVM parameters: -Djava.util.logging.config.file=d:\TeamCity\bin\..\conf\logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xrs -Xmx512m -XX:MaxPermSize=270m -Dlog4j.configuration=file:../conf/teamcity-server-log4j.xml -Dteamcity_logs=../logs/ -Djsse.enableSNIExtension=false -Djava.endorsed.dirs=d:\TeamCity\bin\..\endorsed -Dcatalina.base=d:\TeamCity\bin\.. -Dcatalina.home=d:\TeamCity\bin\.. -Djava.io.tmpdir=d:\TeamCity\bin\..\temp

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - Servlet real path: d:\TeamCity\bin\..\webapps\ROOT\

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the TeamCity Data Directory

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - TeamCity Data Directory path is determined using the environment variable TEAMCITY_DATA_PATH

[2014-08-06 09:59:53,257]   INFO -  jetbrains.buildServer.STARTUP - Data Directory "D:\TeamCityData" exists

[2014-08-06 09:59:53,272]   INFO -  jetbrains.buildServer.STARTUP - The main configuration file "D:\TeamCityData\config\main-config.xml" doesn't exist

[2014-08-06 09:59:53,272]   INFO -  jetbrains.buildServer.STARTUP - The database properties file "D:\TeamCityData\config\database.properties" doesn't exist

[2014-08-06 09:59:53,272]   INFO -  jetbrains.buildServer.STARTUP - The internal database data file "D:\TeamCityData\system\buildserver.data" doesn't exist

[2014-08-06 09:59:53,272]   INFO -  jetbrains.buildServer.STARTUP - Startup confirmation is required. Open TeamCity web page in the browser.

[2014-08-06 09:59:53,272]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Confirming TeamCity first start (administrator login is required to proceed)

[2014-08-06 10:00:55,941]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Initializing Data Directory

[2014-08-06 10:00:55,941]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:07:22,941]   INFO -  jetbrains.buildServer.STARTUP - JDBC loader: loading JDBC drivers (for the first time)

[2014-08-06 10:18:40,372]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:18:40,372]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:18:40,372]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:18:41,448]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:22:18,610]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:22:18,610]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:22:18,610]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:22:18,641]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:23:09,266]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:23:09,266]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:23:09,266]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:23:09,312]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:23:13,228]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:23:13,228]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:23:13,228]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:23:13,244]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:23:28,174]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:23:28,174]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:23:28,174]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:23:28,205]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:25:59,812]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:25:59,812]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:25:59,828]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:25:59,875]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:30:44,852]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:30:44,852]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:30:44,852]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:30:44,899]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:30:55,928]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:30:55,928]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:30:55,928]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:30:55,975]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:31:03,401]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:31:03,401]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:31:03,401]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:31:03,417]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:31:16,818]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:31:16,818]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:31:16,818]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:31:16,864]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:31:45,523]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:31:45,523]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:31:45,523]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:31:45,741]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:32:04,930]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:32:04,930]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:32:04,930]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:32:04,945]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:32:16,771]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:32:16,771]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:32:16,771]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:32:16,786]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:32:20,094]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominsta:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:32:20,094]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:32:20,094]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:32:20,109]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:35:18,143]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:35:18,143]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:35:18,143]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:35:18,159]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:35:27,535]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:35:27,535]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:35:27,535]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:35:27,566]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:35:39,641]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:35:39,641]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:35:39,641]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:35:39,672]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:35:52,745]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:35:52,745]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:35:52,745]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:35:52,823]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:38:07,176]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:38:07,176]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:38:07,176]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:38:07,207]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:38:13,556]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1434;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:38:13,556]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:38:13,556]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:38:28,564]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:39:12,074]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:39:12,074]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:39:12,074]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:39:12,121]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:41:44,695]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:41:44,695]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:41:44,695]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:41:44,742]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:41:58,938]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:41:58,938]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:41:58,938]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:41:58,985]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)

[2014-08-06 10:42:03,338]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:42:03,338]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:42:03,338]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:42:03,369]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)
--------
At this stage I gave up and created the database dbTeamCity on the default instance, and then it goes straight through. Even though the named instance is specified, it is ignored.
--------

[2014-08-06 10:44:40,482]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mydomain.com\mycustominstance:1433;databaseName=dbTeamCity;user=teamcity;password=********

[2014-08-06 10:44:40,482]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database

[2014-08-06 10:44:40,482]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

[2014-08-06 10:44:41,013]   INFO -  jetbrains.buildServer.STARTUP - JDBC driver version: 4.0 (Microsoft JDBC Driver 4.0 for SQL Server)

[2014-08-06 10:44:41,013]   INFO -  jetbrains.buildServer.STARTUP - Database system version: 10.50.4000 (Microsoft SQL Server)

[2014-08-06 10:44:41,013]   INFO -  jetbrains.buildServer.STARTUP - Connected to the database successfully

[2014-08-06 10:44:41,138]   INFO -  jetbrains.buildServer.STARTUP - Using schema: dbo

[2014-08-06 10:44:41,138]   INFO -  jetbrains.buildServer.STARTUP - Schema contains no tables.

[2014-08-06 10:44:41,153]   INFO -  jetbrains.buildServer.STARTUP - Creating database schema

[2014-08-06 10:44:42,573]   INFO -  jetbrains.buildServer.STARTUP - Using schema: dbo

[2014-08-06 10:44:42,589]   INFO -  jetbrains.buildServer.STARTUP - Schema contains 110 tables.

[2014-08-06 10:44:42,589]   INFO -  jetbrains.buildServer.STARTUP - Database version is 658

0
Comment actions Permalink

Hi, sorry for delay.
If both a portNumber and instanceName are used, the portNumber will take precedence and the instanceName will be ignored (for more details see this link). It looks like instance is not listening on 1433 port.

0
Comment actions Permalink

We have come to the same conclusion, thanks for clarifying with documentation.


But my point is, that I did not specify the portnumber during installation/setup - TeamCity did this on its own, and - in my opinon - this is an error.

To be 100% sure, I created a virtual machine and installed TeamCity again, so I could reproduce the error.

After the product is installed it opens up the browser to continue setup. When faced with the "database connection setup", I download the MSSQL driver and place it in the directory and Refresh JDBC drivers.

Now I fill in my connection options. The values can be seen in this screenshot:

database-connection.jpg

Notice that the Database host[:port] field is "sql.mycompany.com" and not "sql.mycompany.com:1433". However, when viewing the teamcity-server.log, I can see that TeamCity has appended the port 1433 to the connection-string, even though this is NOT what I specified:

[2014-08-11 13:47:23,494]   INFO -  jetbrains.buildServer.STARTUP - Startup confirmation is required. Open TeamCity web page in the browser.
[2014-08-11 13:47:23,496]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Confirming TeamCity first start (administrator login is required to proceed)
[2014-08-11 13:48:17,390]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Initializing Data Directory
[2014-08-11 13:48:17,406]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Setup database connection (administrator login is required to proceed)
[2014-08-11 13:52:52,086]   INFO -  jetbrains.buildServer.STARTUP - JDBC loader: loading JDBC drivers (for the first time)
[2014-08-11 13:53:33,660]   INFO -  jetbrains.buildServer.STARTUP - Generated JDBC connection string: jdbc:sqlserver://sql.mycompany.com\myinstancename:1433;databaseName=dbTeamCity;user=teamcity;password=********
[2014-08-11 13:53:33,660]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Creating a new database
[2014-08-11 13:53:33,660]   INFO -  jetbrains.buildServer.STARTUP - Creating a new database

It might be a gray area, whether this is a bug or not, since it's against Best Practice not to specify portnumber when using a named instance (in my case I actually don't know the port-number). But if TeamCity had connected to what I specified, it would have saved me a few hours of frustration when installing the product.



As a side-note: We now have TeamCity up and running and have configured one-click-deployment of our websites. We will soon hit the 20 build configuration barrier and then we will be buying the Enterprise Server License. Great product!

0
Comment actions Permalink

Many thanks for the provided example. I've created a case - https://youtrack.jetbrains.com/issue/TW-37586, please watch/vote for it. We will discuss internally how it's better to handle it.

0

Please sign in to leave a comment.