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.
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 expectedCommon 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
- Build the
.teamcityproject locally so compile errors surface before push (Mavenmvn -f .teamcity/pom.xml teamcity-configs:generate). - Fix the reported type or reference error.
- Commit and let TeamCity apply the settings, or use "Load project settings from VCS".
mvn -f .teamcity/pom.xml teamcity-configs:generateRestore 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
.teamcitybuild. - Treat versioned settings as code with review and CI validation.