Skip to content
Latchkey

TeamCity ".teamcity" DSL compilation error on settings update in CI

With settings stored in VCS, every push to the .teamcity directory triggers a recompile. If compilation fails, TeamCity keeps the last good settings and reports an update error so a broken commit does not silently change your configuration.

What this error means

After a commit to .teamcity, the project shows "Failed to update project settings" or a compilation error, and the change does not take effect until the DSL compiles.

TeamCity
Error while applying changes from VCS to project settings:
.teamcity/_Self/buildTypes/Build.kt:18: error: type mismatch: inferred type is String but Int was expected

Common causes

A broken commit to the versioned settings

A change to a .kt or settings.kts file in .teamcity introduced a compile error, so the whole settings model fails to build.

Missing or mismatched DSL dependencies

The .teamcity build setup references DSL artifacts that are unavailable or a different version than the code expects.

How to fix it

Compile the settings before committing

  1. Build the .teamcity project locally so compile errors surface before push (Maven mvn -f .teamcity/pom.xml teamcity-configs:generate).
  2. Fix the reported type or reference error.
  3. Commit and let TeamCity apply the settings, or use "Load project settings from VCS".
Terminal
mvn -f .teamcity/pom.xml teamcity-configs:generate

Restore the last good settings while you fix

TeamCity retains the previous working settings on a failed compile, so builds keep running; fix the DSL and push again to apply the change.

How to prevent it

  • Validate the DSL in a pre-merge check so broken settings never reach the main branch.
  • Pin DSL dependency versions in the .teamcity build.
  • Treat versioned settings as code with review and CI validation.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →