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
Please sign in to leave a comment.
Hello Kevin,
could you please attach:
Thanks
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
I've just updated to the MS driver, let's see if that makes a difference,
Kevin
The update doesn't appear to have changed anything - I'm still seeing the error,
Kevin
Can you please try to add dependency on Teamcity service to ensure that it starts and stops after SQL server has started.
Thanks Alina,
I've added the dependency - it has booted OK.
I'll let you know if it fails again,
Kevin
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…
Hi Leonid,
thanks for the information,
Kevin
I've filed the issue: http://youtrack.jetbrains.com/issue/TW-36855
You're welcome to watch/vote for it.