Kotlin DSL compilation errors after upgrade to 2023.05

We heavily use the Kotlin DSL for coding our build pipelines.
After updating from 2022.04 to 2023.05 we get lots of errors.
We followed the "Upgrading DSL" guide and use the latest version
https://www.jetbrains.com/help/teamcity/upgrading-dsl.html#Kotlin+DSL+API+version

 

    Kotlin DSL compilation errors
    Compilation error settings.kts[2:45]: Unresolved reference: triggers
    Compilation error settings.kts[3:45]: Unresolved reference: buildSteps
    Compilation error settings.kts[18:9]: Unresolved reference: script
    Compilation error settings.kts[19:13]: 'var name: String' can't be called in this context by implicit receiver. Use the explicit one if necessary
    Compilation error settings.kts[19:13]: 'fun `<set-name>`(`<set-?>`: String): Unit' can't be called in this context by implicit receiver. Use the explicit one if necessary
    Compilation error settings.kts[20:13]: Unresolved reference: scriptContent
    Compilation error settings.kts[32:9]: 'fun vcs(init: VcsSettings.() -> Unit): Unit' can't be called in this context by implicit receiver. Use the explicit one if necessary
    Compilation error settings.kts[42:9]: Unresolved reference: script
    Compilation error settings.kts[43:13]: 'var name: String' can't be called in this context by implicit receiver. Use the explicit one if necessary
 
2
6 comments

When I import the pom.xml as a maven project in my local IntelliJ, I get the same errors. It seems that many classes are missing in the configs-dsl-kotlin-latest-2023.05.jar

0

Or rather it looks like the configs-dsl-kotlin-plugins-latest is missing a lot of dependencies it used to have before.

Before (2022.10):

After (2023.05):

0
Hi, can you share a sample settings project that reproduces the issue? Feel free to use this service to upload the files: https://uploads.jetbrains.com/ (don't forget to specify the upload ID).
0

@Anatoly Cherenkov
Upload id: 2023_07_25_5LtNXVokUmssBnZ7QGvP1J
On-Premise, TeamCity Professional 2023.05.2 (build 129341)
Freshly regenerated, with the same problems.
(I mean TeamCity now can't generate working DSL because of missing dependencies, as of the release of 2023.05)

I use TeamCity docker on K8s, so the image tag - `jetbrains/teamcity-server:latest`
Linux AMD64/ARM64, no difference.

0

After contacting jetbrains support I was able to solve my problem by following this procedure:

  1. Remove manually files plugins.properties and plugins-latest.properties from <TeamCity Data Directory>/system/caches/pluginsDslCache;
  2. Then open Administration -> Diagnostics -> Caches and reset pluginsDslCache (only this one).

Then you need to wait for 10 minutes for recompilation of all plugins and try again.

1

Bastian Voigt, thanks!

For the history, just removing of plugins* doesn't help, but drop the whole

<TeamCity Data Directory>/system/caches/pluginsDslCache

helps

0

Please sign in to leave a comment.