Cannot Connect to Database until Server is Restarted Follow
I recently migrated to using an external database and that all seems to be fine. All my data was there, the migration went smoothly (apart from the confusing and outdated documentation). However, when ever the machine is rebooted, initially TeamCity says that the login for the database failed. If I pop over to the Services and Restart the Teach City Server and then go back to the Team City view in the browser the app goes through an initialisation process and then connects to the database without any problems at all.
Anyone seen this?
Please sign in to leave a comment.
Which version of TeamCity do you use? Can you please attach your newly created target database properties file and teamcity-server.log?
I'm using TeamCity 8.1.1 (build 29939)
The complete error text I see is:
My database.properties file contains:
# This is a sample file for configuring TeamCity to use an external database.
# To make it effective, copy it to the "database.properties" file and modify the settings
# according to your environment.
# Do not modify this file, it will be overwritten on the TeamCity server start-up.
# See documentation at http://confluence.jetbrains.com/display/TCD8/Setting+up+an+External+Database
# Database: Microsoft SQL server (via jtds driver)
# Note: the following two properties are *not* used in case of Integrated Authentication.
# The maximum number of connections TeamCity can open on the database server.
# Specifies whether TeamCity should check each jdbc connection before use.
# It reduces the system performance but avoids cases when the system uses
# a connection that was closed by the database server due to a time-out or this
# connection was broken during the previous operation.
And I've attached the teamcity-server.log file.
I don't know if this is related but I just noticed that TeamCity started running my unit tests twice, there have been zero build configuration changes and zero build script changes ... all of sudden it also stopped running the unit tests twice ...
Can you please also provide us with debug-all logs while reproducing the issue? To turn on this logging mode from the start up of TC server please follow this guide http://confluence.jetbrains.com/display/TCD8/TeamCity+Server+Logs#TeamCityServerLogs-loggingPreset.
Here is the server log with DEBUG level logging.
Thank you for logs. We are not 100% sure, but we think that the service dependencies can help in this case. Can you please add dependency on Teamcity service to ensure that it starts and stops after SQL server has started. To configure it follow this link - http://serverfault.com/questions/24821/how-to-add-dependency-on-a-windows-service-after-the-service-is-installed. Please inform us about the result.
I added the dependency (see screen shot) but the problem still isn't solved.
Which version of MS SQL do you use? And which authentication method is used?
At the moment its using MSSQL Express and it's using a specific SQL login.
I've filed the issue: http://youtrack.jetbrains.com/issue/TW-36855
You're welcome to watch/vote for it.