Affected versions: 2026.1.3 (server-side resolution), TeamCity Cloud 2027.1 EAP (agent-side generation)
Problem
Builds stay queued with Build settings have not been finalized, or the Finalize build settings stage takes a long time. This affects projects that use versioned settings in the Kotlin DSL format with custom dependencies in .teamcity/pom.xml.
Server thread dumps taken during the stall show "Queued builds settings freezer" threads inside AbstractHttpClientWagon.backoff. In the wire-level Maven logging, HTTP 429 responses are recorded from repo.maven.apache.org for maven-metadata.xml requests for -SNAPSHOT versions of packages, potentially including org.jetbrains.teamcity:configs-dsl-kotlin-*:1.0-SNAPSHOT that are provided by the TeamCity server itself.
When Kotlin DSL runs on a build agent, the DSL settings generator job fails instead. Its step DSL execution step (Maven) ends with:
Could not transfer artifact io.opentelemetry:opentelemetry-bom:pom:1.46.0 from/to teamcity-space (https://packages.jetbrains.team/maven/p/tc/maven): status code: 401, reason phrase: Unauthorized (401)
The project then reports Failed to load build settings from VCS, and the next build waits with Build settings have not been found. In the step log, each OpenTelemetry BOM request to repo.maven.apache.org takes about 30 seconds and logs no response.
Note: This problem is distinct from Builds fail with '429 Too Many Requests' when resolving dependencies via Maven Central, which addresses HTTP 429 from Maven Central in build steps (not in Kotlin DSL dependency resolution).
Cause
Whenever a DSL project has custom dependencies, TeamCity appends Maven Central to the resolution repository list under the ID DefaultMavenRepository, even though .teamcity/pom.xml does not declare it.
For SNAPHOT versions of dependencies, Maven asks every repository on that list which build is newest, regardless of repository order. TeamCity generates its own configs-dsl-kotlin-* artifacts per server at version 1.0-SNAPSHOT, so those metadata lookups repeat on every settings finalization. Maven Central never hosts -SNAPSHOT artifacts, but the request volume trips its rate limit. Each 429 response makes Maven wait and retry, which occupies the settings freezer thread pool and blocks finalization for unrelated projects.
On a build agent, the generator job resolves the dependencies of teamcity-configs-maven-plugin from a local repository in the checkout directory, which is empty on a new cloud agent. io.prometheus:prometheus-metrics-tracer-common in that dependency tree imports OpenTelemetry BOMs. Maven resolves an imported BOM with the central repository of Maven's super POM, https://repo.maven.apache.org/maven2, so a central override in .teamcity/pom.xml does not apply to it. When Maven Central does not serve the BOM to the agent, for example because of its rate limits, Maven reports the 401 from teamcity-space. The published plugin POM declares this internal JetBrains repository (TW-87754), and anonymous requests to it always get a 401. The 401 is not the cause. Maven Central rate limits on JetBrains-hosted agents are tracked in TCC-708.
Resolution
The unnecessary snapshot lookups are tracked as TW-102805. When fixed, the workaround should not be required.
Workaround:
Redirect the implicitly added repository to an internal Maven repository that proxies Maven Central.
-
In the internal repository manager, identify a repository that proxies Maven Central, for example
https://repo.example.com/maven-central-proxy. -
Create a file named
mavenSettingsDsl.xml:<settings> <mirrors> <mirror> <id>central-rpoxy</id> <url>https://repo.example.com/maven-central-proxy</url> <mirrorOf>central,DefaultMavenRepository</mirrorOf> </mirror> </mirrors> </settings>WARNING: Keep both IDs in the
<mirrorOf>block.DefaultMavenRepositoryis the repository that TeamCity adds for server-side resolution.centralis the repository of the BOM imports in agent-side generation. A mirror ofDefaultMavenRepositoryalone does not fix the agent-side failure. -
Upload it on the Maven Settings page of the Root project. Subproject copies are ignored for DSL resolution.
-
For agent-side generation, check that the DSL execution step (Maven) of the next DSL settings generator job passes
-Dcontext.mavenSettingsName=mavenSettingsDsl.xml.
Note: If there is no internal proxy or mirror of Maven Central, use Google's Maven Central mirror with the URL https://maven-central.storage-download.googleapis.com/maven2, and keep central,DefaultMavenRepository in the <mirrorOf> block.
The mirror applies to every project on the server and requires no per-project changes or server restarts. It affects Kotlin DSL resolution on the server and the DSL execution step (Maven) of agent-side generation, which uses mavenSettingsDsl.xml as its Maven settings file. Maven build steps in build configurations are unaffected.
Comments
0 comments
Please sign in to leave a comment.