SVN Checkout on Server fails: Proxy Error

For some of my projects, I get this error:
Error while applying patch: Server returned status code 502, reason: Proxy Error

I have used the Clean button on the configurations and the agents. And restarted the agents and the server. But I still get the same error message.

It seems to start up randomly, then never go away. I can't seem to track it back to a particular check-in or build run that triggers it.

Is there some cache/etc that I could clear on the server that might fix this? Or a way to get more information about what is exactly causing it to stop working?

                  • Build Log *********

: Checking for changes
: Building in c:\builda~1\work\Server\Project1
: Getting project sources
: Error while applying patch: Server returned status code 502, reason: Proxy Error
: Publishing artifacts (<1s)
: Publishing artifacts build/installer/project.msi to root artifacts directory
: Artifacts path build/installer/project.msi not found
: Build finished

                  • On Server (note time is ~10m later, this error is repeated many times) *********

ERROR - r.vcs.patches.PatchBuilderImpl - ClientAbortException: java.net.SocketException: Broken pipe

java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at jetbrains.buildServer.vcs.patches.PatchBuilderImpl.changeOrCreateBinaryFile(PatchBuilderImpl.java:61)
at jetbrains.buildServer.vcs.patches.PatchBuilderImpl.changeOrCreateBinaryFile(PatchBuilderImpl.java:126)
at jetbrains.buildServer.buildTriggers.vcs.svn.TCSvnUtil.sendFile(TCSvnUtil.java:131)
at jetbrains.buildServer.buildTriggers.vcs.svn.ExportEditor.closeFile(ExportEditor.java:57)
at org.tmatesoft.svn.core.internal.io.dav.handlers.DAVEditorHandler.endElement(DAVEditorHandler.java:275)
at org.tmatesoft.svn.core.internal.io.dav.handlers.BasicDAVHandler.endElement(BasicDAVHandler.java:70)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1772)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2923)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:635)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:600)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:196)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:291)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:236)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:224)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:219)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:211)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.update(DAVRepository.java:617)
at jetbrains.buildServer.buildTriggers.vcs.svn.SvnConnection.exportFiles(SvnConnection.java:133)
at jetbrains.buildServer.buildTriggers.vcs.svn.SvnConnection.buildPatch(SvnConnection.java:353)
at jetbrains.buildServer.buildTriggers.vcs.svn.SvnSupport.buildPatch(SvnSupport.java:62)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:568)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:494)
at jetbrains.buildServer.serverSide.impl.BuildStarter$3.run(BuildStarter.java:3)
at java.lang.Thread.run(Thread.java:619)

                  • On Server *********

INFO - tbrains.buildServer.ACTIVITIES - Configuration added to queue; name=Project1 :: Config1; requestor=jameslee
INFO - tbrains.buildServer.ACTIVITIES - Build started; name=Project1 :: Config1, personal=false, buildId=16221
INFO - tbrains.buildServer.ACTIVITIES - Configuration removed from queue; name=Project1 :: Config1, requestor=jameslee, comment=null, user=null
INFO - jetbrains.buildServer.SERVER - Running build saved to DB: 16221 Config1 on agent Win2003 (thor)
INFO - jetbrains.buildServer.SERVER - Sent authentication required header for request URI: /httpAuth/createPatch.html
INFO - jetbrains.buildServer.VCS - Requesting patch for root svn-password=*****
svn-use-default-config-directory=true
url=https://svn/svn/repos/project1/trunk
user=ci
cleanPatch = trueprevVersion=nullnewVersion=2007/07/18 10:32:33 -0700; buildId = 16221
INFO - tbrains.buildServer.ACTIVITIES - Finishing build 16221, name: Config1, personal: false, failed: true, interrupted: false, cancelled: null
INFO - serverSide.impl.DBBuildHistory - Start creating history entry for Config1 16221, date: 1184780009000
INFO - serverSide.impl.DBBuildHistory - End creating history entry for Config1 16221
INFO - jetbrains.buildServer.SERVER - Finished 16221
INFO - trollers.CreatePatchController - ClientAbortException: java.net.SocketException: Broken pipe
ClientAbortException: java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:278)
at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:103)
at java.io.FilterOutputStream.close(FilterOutputStream.java:143)
at java.io.FilterOutputStream.close(FilterOutputStream.java:143)
at jetbrains.buildServer.vcs.patches.PatchBuilderImpl.close(PatchBuilderImpl.java:92)
at jetbrains.buildServer.serverSide.impl.BuildStarter.buildPatch(BuildStarter.java:22)
at jetbrains.buildServer.serverSide.impl.BuildServerImpl.buildPatch(BuildServerImpl.java:807)
at jetbrains.buildServer.controllers.CreatePatchController.doHandle(CreatePatchController.java:17)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:10)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:348)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:746)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:348)
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:769)
at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:123)
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:579)
at org.apache.coyote.Response.doWrite(Response.java:559)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361)
... 33 more
INFO - trollers.CreatePatchController - ClientAbortException: java.net.SocketException: Broken pipe
ClientAbortException: java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:278)
at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:103)
at java.io.FilterOutputStream.close(FilterOutputStream.java:143)
at java.io.FilterOutputStream.close(FilterOutputStream.java:143)
at jetbrains.buildServer.vcs.patches.PatchBuilderImpl.close(PatchBuilderImpl.java:92)
at jetbrains.buildServer.serverSide.impl.BuildStarter.buildPatch(BuildStarter.java:22)
at jetbrains.buildServer.serverSide.impl.BuildServerImpl.buildPatch(BuildServerImpl.java:807)
at jetbrains.buildServer.controllers.CreatePatchController.doHandle(CreatePatchController.java:17)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:10)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:348)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:746)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:348)
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:769)
at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:123)
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:579)
at org.apache.coyote.Response.doWrite(Response.java:559)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361)
... 33 more

                  • On Agent ******** *

INFO - jetbrains.buildServer.AGENT - Found runner Ant for


INFO - jetbrains.buildServer.AGENT - Getting sources...
INFO - jetbrains.buildServer.AGENT - Requesting patch from server, cleanPatch=true
WARN - jetbrains.buildServer.AGENT - Failed to apply patch.
java.io.IOException: Server returned status code 502, reason: Proxy Error
at jetbrains.buildServer.agent.impl.ServerStreamProvider.getStream(ServerStreamProvider.java:53)
at jetbrains.buildServer.agent.impl.PatchStreamProviderImpl.getPatchesStream(PatchStreamProviderImpl.java:39)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.applyPatch(BuildAgentImpl.java:775)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.getProjectSources(BuildAgentImpl.java:578)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$1300(BuildAgentImpl.java:50)
at jetbrains.buildServer.agent.impl.BuildAgentImpl$6.run(BuildAgentImpl.java:482)
at java.lang.Thread.run(Unknown Source)
INFO - jetbrains.buildServer.AGENT - Sources loaded for 120 seconds
INFO - jetbrains.buildServer.AGENT - Publishing artifacts build/installer/project.msi to root artifacts directory
WARN - jetbrains.buildServer.AGENT - Artifacts path build/installer/project.msi not found
INFO - jetbrains.buildServer.AGENT - Done publishing artifacts build/installer/project.msi, total files published: 0
INFO - jetbrains.buildServer.AGENT - Build finished: 16221

2 comments

Hello James,

I suppose that there is some proxy server between TeamCity and your version control, and when gathering changes, it sometimes broke the connection. If you use some proxy server (ask your admin if unsure), try to bypass it.

Another possible workaround - try using http protocol instead of https (if this is possible)

Hope this helps,

KIR

0

Ok, so I managed to fix the issue. But am not sure why this is causing a problem and only for this particular tree in this particular subversion repository.

Changing to http instead of https didn't make any difference.

BUT, we are using an apache web service to forward a dns name, since we have multiple webservices running on this box. When I referenced the machine:port directly (serverUrl=http://web03:8111) in the buildAgent.properties file on the agents. With this change, the problem went away.

I figure it must have been hitting some edge case of the patch builder/requester code. Since all my other builds (>30) work correctly with it set the other way.

0

Please sign in to leave a comment.