TeamCity "Failed to collect changes ... Authentication failed" in CI
TeamCity polls the VCS root to detect new commits and the Git server rejected its credentials. Change collection stops, so no new builds are triggered from that repository until authentication is fixed.
What this error means
The VCS root shows an error and builds stop triggering: "Failed to collect changes ... Authentication failed" or "not authorized" against the repository URL.
Failed to collect changes, error: List remote refs failed:
'https://github.com/acme/app.git': Authentication failedCommon causes
Expired or revoked VCS credentials
The personal access token, password, or SSH key stored in the VCS root expired, was rotated, or lost access to the repository.
Wrong authentication method for the URL
An HTTPS URL configured with password auth (where the host now requires a token), or an SSH URL without a matching key, is rejected.
How to fix it
Update the VCS root credentials
- Open the VCS root, Edit, and re-enter a valid token or password (or upload a working SSH key).
- Use the "Test connection" button to confirm authentication succeeds.
- Save; change collection resumes on the next poll.
Match the auth method to the repository host
For hosts that require tokens over HTTPS, store a personal access token as the password; for SSH URLs, register the private key in the VCS root and add its public key to the repository.
# SSH URL form for a VCS root
git@github.com:acme/app.gitHow to prevent it
- Rotate VCS tokens before they expire and update the VCS root in one place.
- Use "Test connection" after any credential change.
- Prefer least-privilege deploy tokens or keys scoped to the repository.