TeamCity fails to start correctly

I get this error frequently when starting TC

Cannot open database "TeamCity" requested by the login. The login failed.
SQL query: connect
SQL exception: Cannot open database "TeamCity" requested by the login. The login failed.

If I restart the TC service then TC starts normally.


I'm using TC 8.0.6
SQL Server 2008R2
SQL Authentication

I've not seen this reported anywhere else - anybody have any ideas?

Thanks,

Kevin

9 comments
Comment actions Permalink

Hello Kevin,

could you please attach:

  • the 'teamcity-server.log' file
  • the 'database.properties' file (without passwords, of course)
  • list of the 'lib/jdbc' directory (with dates and sizes)


Thanks

0
Comment actions Permalink

Sorry for the (very) late reply

I've attached the log file.

database.properties looks like this:

connectionUrl=jdbc:jtds:sqlserver://localhost:1433/TeamCity
connectionProperties.user=TeamCity
connectionProperties.password=************

The buildsever/lib/jdbc directory contains

jtds-1.2.5.jar dated 30/12/2009

Thanks

Kevin Jones



Attachment(s):
teamcity-server.log.zip
0
Comment actions Permalink

I've just updated to the MS driver, let's see if that makes a difference,

Kevin

0
Comment actions Permalink

The update doesn't appear to have changed anything - I'm still seeing the error,

Kevin

0
Comment actions Permalink

Can you please try to add dependency on Teamcity service to ensure that it starts and stops after SQL server has started.

0
Comment actions Permalink

Thanks Alina,

I've added the dependency - it has booted OK.

I'll let you know if it fails again,

Kevin

0
Comment actions Permalink

Kevin, thank you for the update.

Let me explain some details.

When TC starts, it attempts to connect to a database, with credentials, specified in the 'database.properties'. If the RDBMS is not started yet, TC gets a kind of TCP/IP error (like the port is not listened by someone, or connection time out). TC threats it as the RDBMS is not started yet, and attempt to connect again several seconds later.

However, in our case it looks like RDBMS is started but the database of users is not loaded completely, so when TC attempts to connect the RDBMS responds "Cannot open database "TeamCity" requested by the login. The login failed". A similar error occurs when there is a typo in the database name specified in the 'database.properties', or DBA didn't configure the login properly. Both mentioned errors are permanent, so TC stops its attempts to connect.

If we could somehow tell when MS SQL server is not started completely from when the user configured incorrectly, we'd fix the problem on TC side…

0
Comment actions Permalink

Hi Leonid,

thanks for the information,

Kevin

0
Comment actions Permalink

I've filed the issue: http://youtrack.jetbrains.com/issue/TW-36855
You're welcome to watch/vote for it.

0

Please sign in to leave a comment.