SQL Server Express Installation Failure

Hi,

I'm trying to release a TeamCity (v6.0.1) onto a Windows Server 2008 server (named PC7).  I've installed SQL Server Express 2008 and I'm able to connect to the database using SQL Server Management Studio.  However, when I try and update TeamCity to run with that as it's database, following http://confluence.jetbrains.net/display/TCD6/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer, TeamCity server fails to run.  It always fails with the "Unable to get information from SQL Server: PC7\SQLEXPRESS".  I know the SQL Browser service needs to run and TCP\IP is enabled on the SQLEXPRESS service as far as I can tell (it says enabled in SQL Server Configuration Manager).  Is there anything else that I need to do get it work?

Thanks,
Kyle

6 comments
Comment actions Permalink

Hi

It seems TeamCity server cannot connect to SQL Browser service. Please make sure it isn't blocked by firewall and Management Studio can access the database using TCP/IP, as in screenshot.

If that doesn't help, please post your database.properties and teamcity-server.log files, right here or to teamcity-feedback[at]jetbrains.com.

Michael



Attachment(s):
SQL connection.PNG
0
Comment actions Permalink

I am able to connect using the database TCP/IP as in your screenshot.  I've also confirmed that it's not blocked by any firewall.  Below are the files.

database.properties:

# This is a sample configuration file for configuring TeamCity to use external database.
# To make it effective, copy it to the "database.properties" file and modify settings
# according to your environment.
# Do not modify this file, it will be overwritten on TeamCity server startup.
# See documentation at http://www.jetbrains.net/confluence/display/TCD5/Setting+up+an+External+Database

# Database: Microsoft SQL server (via jtds driver)   

connectionUrl=jdbc:jtds:sqlserver://PC-KJOHNSON\\SQLEXPRESS:1433/BUILDDB;instance=SQLEXPRESS;
connectionProperties.user=test
connectionProperties.password=test

# The maximum number of connections TeamCity can open on database server.
maxConnections=50

# Specifies whether TeamCity should check each jdbc connection before use.
# It reduces the system performace but avoids cases when the system uses
# a connection that was closed by database server due to time out or this
# connection was broken at the previous operation.
testOnBorrow=true


teamcity-server.log:
[2011-01-05 12:05:46,520]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2011-01-05 12:05:46,895]   INFO -   jetbrains.buildServer.SERVER - TeamCity version: 6.0.1 (build 15816), data format version 418
[2011-01-05 12:05:47,005]   INFO -   jetbrains.buildServer.SERVER - TeamCity data directory: C:\Documents and Settings\kjohnson\.BuildServer
[2011-01-05 12:05:48,552]   INFO -   jetbrains.buildServer.SERVER - Data directory format version: 418
[2011-01-05 12:05:51,520]   INFO -   jetbrains.buildServer.SERVER - Database type: Microsoft SQL Server
[2011-01-05 12:05:51,536]   INFO -   jetbrains.buildServer.SERVER - Database connection URL: jdbc:jtds:sqlserver://PC-KJOHNSON\SQLEXPRESS:1433/BUILDDB;instance=SQLEXPRESS;
[2011-01-05 12:05:52,505]  ERROR -   jetbrains.buildServer.SERVER - Server startup exception: jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Connecting to Microsoft SQL Server
SQL exception: Unable to get information from SQL Server: PC-KJOHNSON\SQLEXPRESS.
jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Connecting to Microsoft SQL Server
SQL exception: Unable to get information from SQL Server: PC-KJOHNSON\SQLEXPRESS.
 at net.sourceforge.jtds.jdbc.MSSqlServerInfo.<init>(MSSqlServerInfo.java:97)
 at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:276)
 at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
 at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:47)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:215)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.setupAndConnectToDB(TeamCityDispatcherServlet.java:111)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.tryToUseDB(TeamCityDispatcherServlet.java:387)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performOneAttempt(TeamCityDispatcherServlet.java:8)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:204)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:91)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Unable to get information from SQL Server: PC-KJOHNSON\SQLEXPRESS.
 ... 13 more
[2011-01-05 12:05:52,505]   INFO -   jetbrains.buildServer.SERVER - Database format version: database is not accessible
0
Comment actions Permalink

Try to remove instance from host name:
connectionUrl=jdbc:jtds:sqlserver://PC-KJOHNSON:1433/BUILDDB;instance=SQLEXPRESS;

0
Comment actions Permalink

Ok, I'm now able to connect.  However, when I try to use integrated security, it fails.  I've dropped the ntlmauth.dll from .BuildServer\lib\jdbc\x86\SSO into my java bin\ directory.  

teamcity-server.log:

[2011-01-05 14:45:42,411]  ERROR -   jetbrains.buildServer.SERVER - Server startup exception: jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Connecting to Microsoft SQL Server
SQL exception: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Connecting to Microsoft SQL Server
SQL exception: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
 at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:615)
 at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:345)
 at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
 at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:47)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:215)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.setupAndConnectToDB(TeamCityDispatcherServlet.java:111)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.tryToUseDB(TeamCityDispatcherServlet.java:387)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performOneAttempt(TeamCityDispatcherServlet.java:8)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:204)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:91)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
 ... 13 more
Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
 at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1893)
 at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:588)
 ... 12 more
[2011-01-05 14:45:42,411]   INFO -   jetbrains.buildServer.SERVER - Database format version: database is not accessible

0
Comment actions Permalink

TeamCity server uses its own bundled JRE, so dll needs to be put to <TeamCity home>\jre\bin folder, not to <Program Files>\Java\...\bin.

But actually, safer solution is to store the file in <TeamCity home>\bin folder. We'll update the documentation.

Michael

0
Comment actions Permalink

Great.  That worked.  Thanks!

0

Please sign in to leave a comment.