Teamcity could not download sbt runner

I added new build step to my build configuration to build scala module using sbt.

sbt-runner.png
And the build fails. The following message is printed in log

[09:30:57][Step 6/10] SBT installation: 'Auto' mode was selected in SBT runner plugin settings (1s)

[09:30:59][Step 6/10] Java home set to: /opt/jdk1.8.0_11

[09:30:59][Step 6/10] SBT home set to: /root/buildAgent/temp/agentTmp/agent-sbt

[09:30:59][Step 6/10] Starting: /opt/jdk1.8.0_11/bin/java -Dagent.home.dir=/root/buildAgent -Dagent.name=SrvMskCil04 -Dagent.ownPort=9090 -Dagent.work.dir=/root/buildAgent/work -Dbuild.number=... -Dbuild.vcs.number... -Djava.io.tmpdir=/root/buildAgent/temp/buildTmp -Dsbt.ivy.home=/root/buildAgent/system/sbt_ivy -Dteamcity.agent.cpuBenchmark=541 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.agent.dotnet.build_id=... -Dteamcity.auth.password=... -Dteamcity.auth.userId=TeamCityBuildId=... -Dteamcity.build.changedFiles.file=/root/buildAgent/temp/buildTmp/changedFiles4748018185323222402.txt -Dteamcity.build.checkoutDir=/root/buildAgent/work/48fe90d7fa0271db -Dteamcity.build.id=2471831 -Dteamcity.build.properties.file=/root/buildAgent/temp/buildTmp/teamcity.build6330173691924569359.properties -Dteamcity.build.tempDir=/root/buildAgent/temp/buildTmp -Dteamcity.build.workingDir=/root/buildAgent/work/48fe90d7fa0271db/dir -Dteamcity.buildConfName=... -Dteamcity.buildType.id=... -Dteamcity.configuration.properties.file=/root/buildAgent/temp/buildTmp/teamcity.config7968174318003290990.properties -Dteamcity.idea.home=/root/buildAgent/plugins/idea -Dteamcity.projectName=... -Dteamcity.runner.properties.file=/root/buildAgent/temp/buildTmp/teamcity.runner323060666018218171.properties -Dteamcity.tests.recentlyFailedTests.file=/root/buildAgent/temp/buildTmp/testsToRunFirst5386188168087675546.txt -Dteamcity.version=9.0.2 (build 32195) -Xmx512m -XX:ReservedCodeCacheSize=128m -Dsbt.log.noformat=true -Dsbt.log.format=false -Dsbt.version=0.13.7 -classpath /root/buildAgent/temp/agentTmp/agent-sbt/bin/sbt-launch.jar:/root/buildAgent/temp/agentTmp/agent-sbt/bin/classes: xsbt.boot.Boot apply -cp /root/buildAgent/temp/agentTmp/agent-sbt/tc_plugin/sbt-teamcity-logger.jar jetbrains.buildServer.sbtlogger.SbtTeamCityLogger clean compile publish

[09:30:59][Step 6/10] in directory: /root/buildAgent/work/48fe90d7fa0271db/edi-scala-xml

[09:31:00][Step 6/10] Getting org.scala-sbt sbt 0.13.7 ...

[09:31:01][Step 6/10]

[09:31:01][Step 6/10] :: problems summary ::

[09:31:01][Step 6/10] :::: WARNINGS

[09:31:01][Step 6/10]  ::::::::::::::::::::::::::::::::::::::::::::::

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]  ::          UNRESOLVED DEPENDENCIES         ::

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]  ::::::::::::::::::::::::::::::::::::::::::::::

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]  :: org.scala-sbt#sbt;0.13.7: last token hasn't been closed in pattern http://artifactory.int:8081/artifactory/ivy-releases/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier$

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]  ::::::::::::::::::::::::::::::::::::::::::::::

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]

[09:31:01][Step 6/10]

[09:31:01][Step 6/10] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

[09:31:01][Step 6/10] unresolved dependency: org.scala-sbt#sbt;0.13.7: last token hasn't been closed in pattern http://artifactory.int:8081/artifactory/ivy-releases/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier$

[09:31:01][Step 6/10] Error during sbt execution: Error retrieving required libraries

[09:31:01][Step 6/10]   (see /root/.sbt/boot/update.log for complete log)

[09:31:01][Step 6/10] Error: Could not retrieve sbt 0.13.7

Please advise what could be a problem?

5 comments
Comment actions Permalink

Hi Ivan,

It seems that the issue is not related to TeamCity runner. Please try to run the build from the command line on the same machine as TeamCity agent, under the same user that the agent is running and with all the same settings. Please follow this guideline.

0
Comment actions Permalink

I'm having somewhat similar (but not identical) with SBT. However, I'm running from a docker build agent (on Linux). When I connect to the agent (docker exec ... /bin/bash) it isn't very clear to me how to follow the guidelines above (e.g., how do I run sbt from the build agent container - where and as what user?).

I was able to run sbt for the project without issue on the host os that houses the JetBraints teamcity agent container.

The symptom with my problem seems to be a bit different than the original post: the build agent will hang at various points along the way. Though currently, I haven't been able to get past this point:

 

[21:35:22]

The build is removed from the queue to be prepared for the start
[21:35:22]
Collecting changes in 1 VCS root
[21:35:23]
Starting the build on the agent Default Agent (Linux)
[21:35:23]
Clearing temporary directory: /opt/buildagent/temp/buildTmp
[21:35:23]
Publishing internal artifacts
[21:35:23]
Using vcs information from agent file: 65d5211277e47297.xml
[21:35:23]
Checkout directory: /opt/buildagent/work/65d5211277e47297
[21:35:23]
Updating sources: server side checkout
[21:35:23]
Step 1/1: Simple Build Tool (Scala) (running for 1m:06s)
[21:35:23]
[Step 1/1] SBT installation: 'Auto' mode was selected in SBT runner plugin settings
[21:35:23]
[Step 1/1] Discovering SBT version
[21:35:23]
[Step 1/1] SBT TeamCity logger installation
[21:35:23]
[Step 1/1] Java home set to: /usr/lib/jvm/java-8-openjdk-amd64
[21:35:23]
[Step 1/1] SBT home set to: /opt/buildagent/temp/agentTmp/agent-sbt
[21:35:23]
[Step 1/1] Prepare SBT run: Write commands to file.
[21:35:23]
[Step 1/1] Starting: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Dagent.home.dir=/opt/buildagent "-Dagent.name=Default Agent (Linux)" -Dagent.ownPort=9090 -Dagent.work.dir=/opt/buildagent/work -Dbuild.number=484 -Dbuild.vcs.number=27188e38e607a9fac0fc26d0c219287886296941 -Dbuild.vcs.number.1=27188e38e607a9fac0fc26d0c219287886296941 -Dbuild.vcs.number.Ccrs_HttpsGithubComCornellCACCcrsRefsHeadsMaster=27188e38e607a9fac0fc26d0c219287886296941 -Djava.io.tmpdir=/opt/buildagent/temp/buildTmp -Dsbt.ivy.home=/opt/buildagent/system/sbt_ivy -Dteamcity.agent.cpuBenchmark=527 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.agent.dotnet.build_id=608 -Dteamcity.auth.password=******* -Dteamcity.auth.userId=TeamCityBuildId=608 -Dteamcity.build.changedFiles.file=/opt/buildagent/temp/buildTmp/changedFiles3701756604753639541.txt -Dteamcity.build.checkoutDir=/opt/buildagent/work/65d5211277e47297 -Dteamcity.build.id=608 -Dteamcity.build.properties.file=/opt/buildagent/temp/buildTmp/teamcity.build6511951450231018525.properties -Dteamcity.build.tempDir=/opt/buildagent/temp/buildTmp -Dteamcity.build.workingDir=/opt/buildagent/work/65d5211277e47297 -Dteamcity.buildConfName=Build -Dteamcity.buildType.id=Ccrs_Build -Dteamcity.configuration.properties.file=/opt/buildagent/temp/buildTmp/teamcity.config2057795999823422972.properties -Dteamcity.projectName=CCRS -Dteamcity.runner.properties.file=/opt/buildagent/temp/buildTmp/teamcity.runner3229270066879971341.properties -Dteamcity.tests.recentlyFailedTests.file=/opt/buildagent/temp/buildTmp/testsToRunFirst7546284445248301538.txt "-Dteamcity.version=2018.1.3 (build 58658)" -Xmx6G -classpath /opt/buildagent/temp/agentTmp/agent-sbt/bin/sbt-launch.jar:/opt/buildagent/temp/agentTmp/agent-sbt/bin/classes: xsbt.boot.Boot "< "/opt/buildagent/temp/agentTmp/commands5261386114181201761.file""
[21:35:23]
[Step 1/1] in directory: /opt/buildagent/work/65d5211277e47297
[21:35:26]
[Step 1/1] [info] Loading project definition from /opt/buildagent/work/65d5211277e47297/project
[21:35:26]
[Step 1/1] [info] Updating {file:/opt/buildagent/work/65d5211277e47297/project/}root-65d5211277e47297-build...
[21:35:26]
[Step 1/1] [info] Resolving io.spray#sbt-revolver;0.8.0 ...
[21:35:26]
[Step 1/1] [A
[21:35:26]
[Step 1/1] [2K[info] Resolving com.eed3si9n#sbt-assembly;0.14.2 ...
[21:35:26]
[Step 1/1] [A
[21:35:26]
[Step 1/1] [2K[info] Resolving org.scalactic#scalactic_2.10;2.2.1 ...
[21:35:26]
[Step 1/1] [A
[21:35:26]

[Step 1/1] [2K[info] Resolving org.scalactic#scalactic_2.10;2.2.1 ...

0
Comment actions Permalink

Also, if I can't fix it on my end, I'd be happy to provide a stripped down version of my repository (since this seems to show up during the dependency fetching phase), if that helps.

0
Comment actions Permalink

Hi Brandon,

 

If the issue is not the exact same than a topic that is several years old, it would be better to create a new topic instead.

 

To your specific issue, if you can replicate it consistently within teamcity but the same issue doesn't happen in your dev environment, please follow the steps here to check and report: https://confluence.jetbrains.com/display/TCD18/Common+Problems#CommonProblems-BuildworkslocallybutfailsormisbehavesinTeamCity

0
Comment actions Permalink

My current problem is that I'm not sure how to attempt all of the steps described with my configuration, which uses a Docker teamcity agent, namely this step:

> log in to the agent machine using the same user as the one running the TeamCity agent (check the right user in the machine processes list)

I'm familiar with Docker but now how the teamcity agent runs in it, sets up the environment, etc.

0

Please sign in to leave a comment.