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
0
11 comments

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?

0
Avatar
Permanently deleted user

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.

0

Hello Alexander,

What verion of Gradle is configured in Gradle Wrapper?

0
Avatar
Permanently deleted user

Nikita,

 

We are using 2.14.1 on this particular project.

 

Alex

0

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.

0
Avatar
Permanently deleted user

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:

 

acarman-teamcity-agent.log (477 kb)
acarman-Update_All_Snapshot_All_Superset_115.log (4 kb)
0

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.

0
Avatar
Permanently deleted user

Nikita,

 

It comes back blank like:

 

[Step 1/1] Effective opts are:[]

0
Avatar
Permanently deleted user

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

0

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.

 

0
Avatar
Permanently deleted user

Vladislav,

The output was:

[Step 1/1] in directory: /home/linuxadmin/buildAgent/work/633e02c7e346144e
[07:06:22][Step 1/1] DEFAULT_JVM_OPTS=
[07:06:22][Step 1/1] JAVA_OPTS=
[07:06:22][Step 1/1] GRADLE_OPTS="-Djava.io.tmpdir=/home/linuxadmin/buildAgent/temp/buildTmp"
[07:06:22][Step 1/1] Effective opts are:[-Djava.io.tmpdir=/home/linuxadmin/buildAgent/temp/buildTmp -Dorg.gradle.appname=gradlew]
 
However your suggestion got me thinking so I regenerated a new wrapper setup from gradle 2.14.1 and put it into this project. Our build started working after I did that. I which is ever so odd because it works fine without that on TeamCity 9.
0

Please sign in to leave a comment.