Failed to perform checkout on agent: Unable to connect to TFS server: Java heap space

Any one deal with this before. Tried everything from disabling my firewall to alternate authentication in TFS but nothing seems to be working. Thanks in advance everyone. Here's more details:

 

[09:28:48]Checkout directory: C:\TeamCity\buildAgent\work\5e0260b1af2c6718
[09:28:48]Updating sources: auto checkout (on agent) (2m:31s)
[09:28:48][Updating sources] Will use agent side checkout
[09:28:48][Updating sources] VCS Root: tfs: https://myurl.visualstudio.com/ $/Local Repo(2m:31s)
[09:31:20][Updating sources] Failed to perform checkout on agent: Unable to connect to TFS server: Java heap space
 
using 2017.1 btw
 
 
0
4 comments

Does it have a stacktrace after that? Usually "Java heap space" is followed by an OutOfMemoryException, that is, the agent didn't have enough memory to continue the process. Could you try to replicate and check whether the process is using too much memory at that point? You might want to expand the memory of the agent. To know how, check here: https://confluence.jetbrains.com/display/TCD10/Configuring+Build+Agent+Startup+Properties

If the issue keeps happening, please report back so we can double check what's going on. If so, please send us a full build log. Use the "Submit a request" link at the top of the page if you want to keep it private.

0
Avatar
Permanently deleted user

jetbrains.buildServer.vcs.VcsRootVcsException: Unable to connect to TFS server: Java heap space
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:81)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:22)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:241)
at jetbrains.buildServer.serverSide.impl.BuildStarter$4.call(BuildStarter.java:16)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:86)
at jetbrains.buildServer.serverSide.impl.BuildStarter$5.call(BuildStarter.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: jetbrains.buildServer.vcs.VcsException: Unable to connect to TFS server: Java heap space
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner$1.apply(TfsJavaWebRunner.java:98)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner$1.apply(TfsJavaWebRunner.java:66)
at jetbrains.buildServer.buildTriggers.vcs.tfs.TfsCacheManager.executeWithReadLock(TfsCacheManager.java:30)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaRunnerBase.executeCommand(TfsJavaRunnerBase.java:204)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner.executeCommand(TfsJavaWebRunner.java:66)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaServerContext.downloadItems(TfsJavaServerContext.java:121)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaBuildPatchPolicy.buildPatch(TfsJavaBuildPatchPolicy.java:58)
at jetbrains.vcs.api.services.patches.BuildPatchUtil.buildPatch(BuildPatchUtil.java:6)
at jetbrains.vcs.api.services.patches.PatchServiceBase.buildPatchImpl(PatchServiceBase.java:19)
at jetbrains.vcs.api.services.patches.CleanPatchServiceImplA.buildCleanPatch(CleanPatchServiceImplA.java:2)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:39)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$200(PatchComposer.java:149)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:3)
at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:40)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:12)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.requestCachedPatchWithVersion(PatchComposer.java:35)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:129)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makeCleanPatch(PatchComposer.java:183)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:109)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:146)
... 9 more
jetbrains.buildServer.vcs.VcsException: Unable to connect to TFS server: Java heap space
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner$1.apply(TfsJavaWebRunner.java:98)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner$1.apply(TfsJavaWebRunner.java:66)
at jetbrains.buildServer.buildTriggers.vcs.tfs.TfsCacheManager.executeWithReadLock(TfsCacheManager.java:30)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaRunnerBase.executeCommand(TfsJavaRunnerBase.java:204)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaWebRunner.executeCommand(TfsJavaWebRunner.java:66)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaServerContext.downloadItems(TfsJavaServerContext.java:121)
at jetbrains.buildServer.buildTriggers.vcs.tfs.java.TfsJavaBuildPatchPolicy.buildPatch(TfsJavaBuildPatchPolicy.java:58)
at jetbrains.vcs.api.services.patches.BuildPatchUtil.buildPatch(BuildPatchUtil.java:6)
at jetbrains.vcs.api.services.patches.PatchServiceBase.buildPatchImpl(PatchServiceBase.java:19)
at jetbrains.vcs.api.services.patches.CleanPatchServiceImplA.buildCleanPatch(CleanPatchServiceImplA.java:2)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:39)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$200(PatchComposer.java:149)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:3)
at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:40)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:12)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.requestCachedPatchWithVersion(PatchComposer.java:35)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:129)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makeCleanPatch(PatchComposer.java:183)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:109)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:146)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:22)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:241)
at jetbrains.buildServer.serverSide.impl.BuildStarter$4.call(BuildStarter.java:16)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:86)
at jetbrains.buildServer.serverSide.impl.BuildStarter$5.call(BuildStarter.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

 

0
Avatar
Permanently deleted user

I also looked at your link and not really sure if says anything about expanding the memory allocation for the Agent or what the recommended memory setting should be. Is this a parameter? Also, this error also happens when I choose to Build On the Server option.

0

Hi Hythamm,

According to the stacktrace exception occurred on TeamCity server side.

You can increase Xmx Java option via teamcity.tfs.java.max.memory internal server property. By default it set to 512M. After that you need to restart TeamCity server to apply changes.

Please let us know if it helps.

0

Please sign in to leave a comment.