TeamCity: SQL exception: Cannot open database – 500 Internal Server Error

The Scenario

I rebooted my TeamCity server following updates.

The Problem

When I start the TeamCity agents they report a 500 Internal Server Error and the login page (http://teamcity-server:8080) reports the error:

SQL exception: Cannot open database requested by the login. The login failed. ClientConnectionId:f17b1159-b183-4241-bc98-c119d1767b49

The Solution

The issue is that the TeamCity Server service is starting and requesting database access before the MSSQL services are ready.

Quick Fix: Restart the TeamCity Server service (sc stop teamcity && sc start teamcity)

Long-term Fix: Change the TeamCity Server service startup type from Automatic to Automatic (Delayed) (sc config teamcity start= delayed-auto)

 

Disclaimer: provided “AS IS” with no warranties and confer no rights

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s