Category Archives: TeamCity

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

TeamCity – Superuser access to UI

The Scenario

Some developers use TeamCity. This instance uses the built-in authentication model, i.e. no LDAP authentication.

The Problem

A team of developers forgot the password to login to their TeamCity server UI. No one had a copy of it so all access was denied.

The Solution

TeamCity provides a Superuser account (enabled by default – check if it’s enabled navigate here: http://<teamcity-server-url>/login.html?super=1 )

You need a security token to proceed, you’ll find this in the teamcity-servers.log file in the location <teamcity_install_directory_root\logs. i.e. C:\TeamCity\logs. A new token is generated each day so search for the latest instance of “Super user authentication token”

To login as superuser navigate to your TeamCity login screen (http://<teamcity-server-url>/login.html ) leave the username field blank and enter the security token as the password. Once logged in you will have full administrator privileges.

 

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