TeamCity "Failed to load Kotlin DSL" settings.kts error in CI
TeamCity compiles the versioned .teamcity/settings.kts Kotlin DSL to build the project configuration. A compile error, wrong DSL version, or bad reference stops the settings from loading and the project shows an error.
What this error means
The project shows "Failed to load DSL" or "Error while loading settings from ...": a Kotlin compilation error naming a line in settings.kts or a _Self file.
Failed to load Kotlin DSL settings:
.teamcity/settings.kts:42:17: error: unresolved reference: dockerCommandCommon causes
A Kotlin DSL compilation error
An unresolved reference, a syntax error, or an API used incorrectly in settings.kts fails compilation, so the configuration cannot be built.
A DSL version mismatch with the server
The version = "..." in the DSL does not match features available on the server, so a symbol the code uses does not exist.
How to fix it
Fix the compile error at the reported line
- Open
.teamcity/settings.ktsat the line and column in the error. - Correct the unresolved reference or syntax, matching the DSL API for your server version.
- Push and let TeamCity reload the settings, or use "Load project settings" to recompile.
// .teamcity/pom.xml or settings.kts version must match the server
version = "2024.03"Align the DSL version and dependencies
Set the DSL version to match the server and ensure the .teamcity Maven/Gradle setup pulls the matching configs-dsl-kotlin artifacts so symbols resolve.
How to prevent it
- Compile the DSL locally (Maven/Gradle) before pushing settings changes.
- Keep the DSL version aligned with the TeamCity server version.
- Review settings.kts changes like code, since they gate the whole project.