Upsource Youtrack integration not working (502)

I am using an external Hub (2017.2.5428), Youtrack (2017.3 Build 35234) and Upsource (2017.2.2057). They are all running on the same Windows 2012 Server.

Some time ago the Upsource Integration for one of our projects stopped working (vcs changes were no longer added to the tickets). Looking at the Upsource Integration Tab in Youtrack shows: "HTTP 502 Bad Gateway Synchronized at 15:10" for one of the projects while the other projects continued to work just fine.

The info log (Upsource-Logs\internal\services\bundleProcess\info.log) shows the following error:

[2017-08-02 15:10:00,105] INFO - undle.proxy.jetty.ProxyServlet - Proxying /~rpc/getRevisionsListUpdate failed: null
org.eclipse.jetty.http.BadMessageException: 500: Request header too large
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:259)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback.process(HttpSenderOverHTTP.java:203)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP.sendHeaders(HttpSenderOverHTTP.java:58)
at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:79)
at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:205)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:202)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:82)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:37)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:27)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:165)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:113)
at org.eclipse.jetty.client.PoolingHttpDestination.send(PoolingHttpDestination.java:97)
at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:201)
at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:538)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
at org.eclipse.jetty.proxy.AbstractProxyServlet.sendProxyRequest(AbstractProxyServlet.java:539)
at org.eclipse.jetty.proxy.ProxyServlet.service(ProxyServlet.java:88)
at com.jetbrains.bundle.proxy.jetty.ProxyServlet.service(ProxyServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:518)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:521)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
at org.eclipse.jetty.http.HttpGenerator.putSanitisedValue(HttpGenerator.java:985)
at org.eclipse.jetty.http.HttpGenerator.putTo(HttpGenerator.java:1001)
at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:718)
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:233)
... 42 more

7 comments
Comment actions Permalink
Hi Stefan,
 
Try putting the following props into .../upsource/conf/upsource.jvmoptions file:
 
 
-Djetbrains.http.response.header.buffer.size=32768
-Djetbrains.http.request.header.buffer.size=32768
 
Will you see any difference after Upsource restart?
0
Comment actions Permalink

Hello Artem,

I got a similar exception with the proposed parameters.

upsource-frontend/launcher.log:

[2017-08-15 20:06:31,246] DEBUG - tbrains.launcher.run.JavaAgent - [configure] Launching Upsource Frontend configuration process with command: [/usr/protei/upsource-2017.2.2197/internal/java/linux-x64/jre/bin/java, -Djl.service=Upsource Frontend, -Djl.home=/usr/protei/upsource-2017.2.2197/apps/upsource-frontend, -ea, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=../../logs/upsource-frontend, -XX:ErrorFile=../../logs
/upsource-frontend/hs_err_pid%p.log, -Dfile.encoding=UTF-8, -Dupsource.properties.file=upsource.properties,../upsource.user.properties, -Djava.net.preferIPv4Stack=true, -Xmx4096m, -XX:MaxMetaspaceSize=512m, -Dbundle.proxy.request.buffer.size=32768, -Djetbrains.http.response.header.buffer.size=32768, -Djetbrains.http.request.header.buffer.size=32768, -jar, launcher/lib/app-wrapper/upsource-frontend-wrapper.jar, AppConfigurator, com.jetbrains.upsource.backend.server.daemon.JointServicesDaemon, -f, /usr/protei/upsource-2017.2.2197/temp/internal/services/bundleProcess/configure-args-6972989261609626779.properties] (at path: "/usr/protei/upsource-2017.2.2197/apps/upsource-frontend", system properties: {launcher.app.lib.dir=../../lib/upsource, launcher.app.home=/usr/protei/upsource-2017.2.2197/apps/upsource-frontend, launcher.app.conf.dir=/usr/protei/upsource-2017.2.2197/apps/upsource-frontend/../../conf/upsource-frontend, java.awt.headless=true, launcher.app.name=Upsource Frontend, launcher.app.logs.dir=/usr/protei/upsource-2017.2.2197/logs/upsource
-frontend})

[2017-08-15 20:12:00,799] INFO - undle.proxy.jetty.ProxyServlet - Proxying /~rpc/getRevisionsListUpdate failed: null
org.eclipse.jetty.http.BadMessageException: 500: Request header too large
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:259)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback.process(HttpSenderOverHTTP.java:203)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP.sendHeaders(HttpSenderOverHTTP.java:58)
at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:79)
at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:205)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:202)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:82)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:37)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:27)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:165)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:113)
at org.eclipse.jetty.client.PoolingHttpDestination.send(PoolingHttpDestination.java:97)
at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:201)
at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:538)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
at org.eclipse.jetty.proxy.AbstractProxyServlet.sendProxyRequest(AbstractProxyServlet.java:539)
at org.eclipse.jetty.proxy.ProxyServlet.service(ProxyServlet.java:88)
at com.jetbrains.bundle.proxy.jetty.ProxyServlet.service(ProxyServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
at com.jetbrains.bundle.proxy.jetty.AllowOriginOneTimeFilter.doFilter(AllowOriginOneTimeFilter.java:37)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:308)
at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:262)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:518)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
at java.nio.ByteBuffer.put(ByteBuffer.java:859)
at org.eclipse.jetty.http.HttpGenerator.putTo(HttpGenerator.java:1000)
at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:718)
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:233)
... 48 more

0
Comment actions Permalink

Hi Artem,

sadly no such luck. Still the same error:

[2017-08-18 13:16:50,637] INFO - undle.proxy.jetty.ProxyServlet - Proxying /~rpc/getRevisionsListUpdate failed: null
org.eclipse.jetty.http.BadMessageException: 500: Request header too large
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:259)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback.process(HttpSenderOverHTTP.java:203)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP.sendHeaders(HttpSenderOverHTTP.java:58)
at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:79)
at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:205)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:202)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:82)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:37)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:27)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:165)
at org.eclipse.jetty.client.PoolingHttpDestination.process(PoolingHttpDestination.java:113)
at org.eclipse.jetty.client.PoolingHttpDestination.send(PoolingHttpDestination.java:97)
at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:201)
at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:538)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
at org.eclipse.jetty.proxy.AbstractProxyServlet.sendProxyRequest(AbstractProxyServlet.java:539)
at org.eclipse.jetty.proxy.ProxyServlet.service(ProxyServlet.java:88)
at com.jetbrains.bundle.proxy.jetty.ProxyServlet.service(ProxyServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:518)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:521)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
at org.eclipse.jetty.http.HttpGenerator.putSanitisedValue(HttpGenerator.java:985)
at org.eclipse.jetty.http.HttpGenerator.putTo(HttpGenerator.java:1001)
at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:718)
at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:233)
... 42 more

0
Comment actions Permalink

Ok, what if you multiply all 3 limits by 10? 

0
Comment actions Permalink

Well, i tried multiplying it with 100, still the same problem. I made sure the config File is working:

[2017-08-18 17:33:28,355]  DEBUG - tbrains.launcher.run.JavaAgent - Launching Upsource Frontend process with command: [C:\Server\Upsource\internal\java\windows-amd64\jre\bin\java.exe, -Djl.service=Upsource Frontend, -Djl.home=C:\Server\Upsource\apps\upsource-frontend, -ea, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=..\..\..\Upsource-Logs\upsource-frontend, -XX:ErrorFile=..\..\..\Upsource-Logs\upsource-frontend\hs_err_pid%p.log, -Dfile.encoding=UTF-8, -Dupsource.properties.file=upsource.properties,../upsource.user.properties, -Djava.net.preferIPv4Stack=true, -Xmx4096m, -XX:MaxMetaspaceSize=512m, -Dbundle.proxy.request.buffer.size=3276800, -Djetbrains.http.response.header.buffer.size=3276800, -Djetbrains.http.request.header.buffer.size=3276800, -jar, launcher\lib\app-wrapper\upsource-frontend-wrapper.jar, AppStarter, com.jetbrains.upsource.backend.server.daemon.JointServicesDaemon] (at path: "C:\Server\Upsource\apps\upsource-frontend", system properties: {launcher.app.lib.dir=../../lib/upsource, launcher.app.home=C:\Server\Upsource\apps\upsource-frontend, launcher.app.conf.dir=C:\Server\Upsource\apps\upsource-frontend\..\..\conf\upsource-frontend, java.awt.headless=true, launcher.app.name=Upsource Frontend, launcher.app.logs.dir=C:\Server\Upsource-Logs\upsource-frontend})

 

But i still get the same error...

0
Comment actions Permalink

Guys,

My fault, file should be .../upsource/conf/upsource.jvmoptions 

0
Comment actions Permalink

Thanks, that worked!

0

Please sign in to leave a comment.