Build error after TeamCity 10 Upgrade
Answered
We are testing an upgrade to TeamCity 10 and a bunch of our builds are throwing this error and I'm not entirely sure how to track it down.
Error: Could not find or load main class "-Djava.io.tmpdir=.home.linuxadmin.buildAgent.temp.buildTmp"
This is the entire build log.
inalize build settings
[14:56:08]Collecting changes in 1 VCS root
[14:56:33]Clearing temporary directory: /home/linuxadmin/buildAgent/temp/buildTmp
[14:56:33]Publishing internal artifacts
[14:56:33]Checkout directory: /home/linuxadmin/buildAgent/work/633e02c7e346144e
[14:56:33]Updating sources: server side checkout
[14:56:34]Resolving artifact dependencies
[14:56:34]Step 1/1: Create Update (Gradle)
[14:56:34][Step 1/1] Starting: bash /home/linuxadmin/buildAgent/work/633e02c7e346144e/gradlew --init-script /home/linuxadmin/buildAgent/plugins/gradle-runner/scripts/init.gradle -PproductVersion=6.5 -PsuDrvVersion=+ -PfacAppVersion=+ -PivuSalVersion=+ -Dorg.gradle.daemon=false -s clean :superset:buildAll
[14:56:34][Step 1/1] in directory: /home/linuxadmin/buildAgent/work/633e02c7e346144e
[14:56:34][Step 1/1] Error: Could not find or load main class "-Djava.io.tmpdir=.home.linuxadmin.buildAgent.temp.buildTmp"
[14:56:34][Step 1/1] Process exited with code 1
[14:56:34][Step 1/1] Step Create Update (Gradle) failed
[14:56:34]Publishing internal artifacts
[14:56:34]Publishing artifacts
[14:56:16]Build finished
Please sign in to leave a comment.
Hello Alexander,
Could you please try to run the same build via command line on the same agent? Does it run successfully?
Could you please attach screenshot of the build step settings and teamcity-agent.log file? On what OS does the agent run?
Alina,
Thanks for the reply. If I run it on the agent directly then yes the build works as expected.
Here's the build step settings

Here's a screen shot of the log at the time that this build ran.
The agent is running on a ubuntu 16.04.1 server with the latest JDK 8 101 installed.
Hello Alexander,
What verion of Gradle is configured in Gradle Wrapper?
Nikita,
We are using 2.14.1 on this particular project.
Alex
Hello Alexander,
Could you please enable debug logging on the build agent (instruction here https://confluence.jetbrains.com/display/TCD10/Viewing+Build+Agent+Logs#ViewingBuildAgentLogs-GenericDebugLogging ), reproduce the issue and attach full build log and teamcity-agent.log file.
Nikita,
I have the files, but can only attach images to this post. Can I email them to you?
EDIT:
Nikita,
I uploaded them to the support site named:
Thank you for the logs.
Please, make a change a small change to script "gradlew"
add line
echo "Effective opts are:[${JVM_OPTS[@]}]"
right above the last one (starting wiht "exec ... ")
commit to repository (or do remote run). The build log should contain new string starting "Effective opts". Please post this line here.
Nikita,
It comes back blank like:
[Step 1/1] Effective opts are:[]
Nikita,
Is there a way I can escalate this issue to the technical support team. Most of our developers have upgraded to the latest version of Idea and can no longer remote run in TeamCity 9. We need to push through this upgrade, but cannot until we can verify that our builds work.
Thanks
Alex
Hi Alexander,
Since Nikita (TeamCity developer responsible for Gradle support) is on vacation, so I'd try to investigate your problem.
>Most of our developers have upgraded to the latest version of Idea and can no longer remote run in TeamCity 9.
They can update TeamCity plugin from plugins repository right in IDEA, that plugin is compatible with TeamCity servers 9.0 - 10.0.
It's quite unexpected that you have output '[Step 1/1] Effective opts are:[]' since gradlew of version 2.14 adds '-Dorg.gradle.appname=$APP_BASE_NAME' in the end, just before executing java, so it should be at least '[Step 1/1] Effective opts are:[-Dorg.gradle.appname=gradlew]'
Ensure your 'gradlew' is new one (2.14 or 2.14.1)
Here's gradlew from 2.14.1 patched with logging related to env variables.
Vladislav,
The output was: