Skip to content
Latchkey

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.

TeamCity
Failed to collect changes, error: List remote refs failed:
'https://github.com/acme/app.git': Authentication failed

Common 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

  1. Open the VCS root, Edit, and re-enter a valid token or password (or upload a working SSH key).
  2. Use the "Test connection" button to confirm authentication succeeds.
  3. 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.

VCS root URL
# SSH URL form for a VCS root
git@github.com:acme/app.git

How 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.

Frequently asked questions

What causes ""Failed to collect changes: Authentication failed""?
The personal access token, password, or SSH key stored in the VCS root expired, was rotated, or lost access to the repository.
How do I fix "Failed to collect changes: Authentication failed"?
Update the VCS root credentials

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card