Subversion checkout fails on TeamCity 4.0 (build 7904): Error while applying patch

I use TeamCity 4.0 (build 7904).
After migration from cvs to svn we got such a problem - TeamCity starts getting changes, is doing it for about 5 minutes, and then failes with error:

[13:07:01]: Checking for changes
[13:07:01]: Checkout directory: /opt/gftcc/teamcity/work/f92b3fa5a715347b
[13:12:01]: Error while applying patch: Server returned status code 502, reason: Proxy Error
[13:12:01]: Build finished

In teamcity-agent.log I found this:
[2009-01-21 13:12:01,901]   WARN -    jetbrains.buildServer.AGENT - Exception occured while patch applying:Server returned status code 502, reason: Proxy Error Server returned status code 502, reason: Proxy Error
        at jetbrains.buildServer.agent.impl.ServerStreamProvider.getStream(
        at jetbrains.buildServer.agent.impl.patch.PatchStreamProviderImpl.getPatchesStream(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources.loadAndApplyPatch(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources.access$300(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources$3.execute(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources.executePatchProcess(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources.applyPatch(
        at jetbrains.buildServer.agent.impl.patch.GetProjectSources.execute(
        at jetbrains.buildServer.agent.impl.runStages.GetSourcesStage.doBuildStage(
        at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(

I haven't found what is patch file and why it's applying fails. Can you help with it?


Comment actions Permalink


The error indicates that there are connection problems between agent and TeamCity server. Agent tries to got the changes from the server in a "patch" file. The file downloading fails with 502 error. Most probably you have a proxy server between the agent and server and it reports the error. The patch file size may be quite big (this depends on the size of your codebase).

If you believe it is not a fault of the proxy server, please send us the server logs (temacity-server.log, teamcity-vcs.log) for the moment of failure.

As a workaround you can try to switch to agent-side checkout.

BTW you are using pre-release build of TeamCIty, please consider upgrading to TeamCity 4.0.1.

Best regards,

Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
"Develop with pleasure!"

Comment actions Permalink

Thanks for your reply.

It's strange, that we didn't have this problem using cvs, isn't it? Is this patch applying when TeamCity uses cvs?

I looked for logs, but teamcity-vcs.log is empty, and I don't see teamcity-server.log at all.

I tryed to switch to "Automatically on agent", but in this case TeamCity worked for about a half of an hour, and I got this in log:

[18:10:01]: Checking for changes
[18:10:02]: Checkout directory: /opt/gftcc/teamcity/work/91e68c12c52569fa
[18:10:02]: Clearing /opt/gftcc/teamcity/work/91e68c12c52569fa
[18:10:02]: Checking /opt/gftcc/teamcity/work/91e68c12c52569fa out from svn
[18:37:12]: Unexpected error: Java heap space
[18:37:12]: java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(
at java.lang.AbstractStringBuilder.expandCapacity(
at java.lang.AbstractStringBuilder.append(
at java.lang.StringBuffer.append(
at org.tmatesoft.svn.core.SVNErrorMessage.getFullMessage(
at org.tmatesoft.svn.core.SVNException.getMessage(
at java.lang.Throwable.getLocalizedMessage(
at jetbrains.buildServer.vcs.svn.SvnCheckoutOnAgentSupport.updateSources(
at jetbrains.buildServer.agent.impl.patch.GetProjectSources.checkoutSources(
at jetbrains.buildServer.agent.impl.patch.GetProjectSources.execute(
at jetbrains.buildServer.agent.impl.runStages.GetSourcesStage.doBuildStage(
at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(

[18:37:12]: Build finished

We are going to upgrade to TeamCity 4.0.1, do you suppose the problem may be dealt with using pre-relase build of TeamCity?

Comment actions Permalink

Many thanks for your reply, it really helped!

We checked carefully our setting and tryed not to use proxy, but set direct link, and it helped.

Comment actions Permalink

Hello Ekaterina,

   Could you please check whether the OutOfMemory error is reproducable and if yes, please send us memory dump as described at .



Comment actions Permalink

Hi Kirill!
Sorry for delay, I remember about your question, but I haven't checked it yet.
I'll check in a couple of days and report you about the result.

Comment actions Permalink

Hi Kirill!
I've checked whether the OutOfMemory error is reproducable just now, and it isn't.

Sorry for delay.


Please sign in to leave a comment.