Symptoms
- PostgreSQL is used as an external TeamCity database.
- Both PostgreSQL and TeamCity are installed on the Windows machine.
- Windows was rebooted.
- After the reboot, TeamCity Server fails to start properly, displaying the maintenance page and a TeamCity Server startup error.
-
The stack trace on the maintenance page includes the following error message:
jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception: SQL error when doing 'Executing a SQL statement' ERROR: type "agent_pool$" already exists
Cause
TeamCity connects to PostgreSQL successfully, then fails while creating its temporary helper table agent_pool$ with the type "agent_pool$" already exists error.
agent_pool$ is a TeamCity temporary table used during normal startup/database operations.
Most likely, it was caused by an abrupt disconnection or an abnormal PostgreSQL shutdown, possibly triggered by a Windows reboot.
Resolution
- Keep TeamCity stopped.
- Take a database backup/snapshot.
- Check PostgreSQL logs from the Windows restart for crash recovery, orphan temp tables, catalog errors, or corruption messages.
- With TeamCity stopped, perform a clean PostgreSQL service restart, then try starting TeamCity.
If the issue is reproduced after a clean restart of the PostgreSQL service, contact TeamCity Support. Include the contents of the <TeamCity Server Home>/logs directory, as well as the full stack trace from the maintenance page, in the ticket.
Comments
0 comments
Please sign in to leave a comment.