Upsource behind proxy

I'm trying to host Upsource on a centOS machine that needs proxy settings for internet. I have set the http_proxy and https_proxy as the environment variables on that machine. Now when I'm trying to add a project which is hosted on github I'm getting this error: "Test VCS connection failed. List remote refs failed: java.net.ConnectException: Connection timed out github.com"

It seems to me that it is not picking up my proxy settings. Is there a setting that I have to specify in Upsource to make it work behind proxy?


10 comments
Hi Sachin,

 
Thanks for your intrest in Upsource.
  
Are you able to connect to your reposiotory through any other client from the same machine? Also logs from Upsource directory will be appreciated. 
  
Upsource uses jgit to communicate with git repositories, so you might want to configure proxy settings through gitconfig by running commands below. But it's more about workaround and we would like to investigate why it doesn't work via environment variables
 
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
0

Hello Artem,

Yes I'm able to connect to repo by directly using git command.

I even added the proxy settings in .gitconfig file still I'm getting the same error.

Please let me know which log file you need.

Thanks,
Sachin

0

Hi Sachin,

Please post entire contents of logs folder from Upsource home directory. You may also send it to upsource-support@jetbrains.com

Thanks in advance.

0

I'm facing the same problem now. Is there any solution for this?

When I try to create a project, the "Test VCS connection" fails. No matter how can I try to set the proxy (.gitconfig or with java opts: -Dhttp.proxyHost etc.).

As I can see, the vcs-worker-impl plugin regrets to use any proxy, despite that it uses JGit inside, and JGit uses a ProxySelector for httpOpen. 

Can you help me how can I configure Upsource to use proxy for VCS connection test?

0

There was an issue on the product side, that is now fixed in the latest 2017.1 update.

Could you please clarify which version you are using?

0

Hello Artem,

I'm using the latest version: 2017.1.1922

I've updated the jre's net.properties file (upsource-2017.1.1922/internal/java/linux-x64/jre/lib/net.properties) to use proxy, and when I run my own little test program with this jre (JGit inside), it uses the proxy, and it can fetch from a git repo.

But the VCS connection test fails in Upsource, with "no route" error message.

The full exception:

[2017-06-09 18:39:48,878] INFO  C: server executor-1                 .impl.client.DefaultHttpClient - Retrying connect to {s}->https://bitbucket.org:443 
[2017-06-09 18:39:51,941] INFO  C: server executor-1                 tion.TestConnectionServiceImpl - TestConnection failed for __test_connection_workspace__:: List remote refs failed: java.net.NoRouteToHostException: No route to host (Host unreachable)
jetbrains.buildServer.vcs.VcsException: List remote refs failed: java.net.NoRouteToHostException: No route to host (Host unreachable)
at jetbrains.buildServer.buildTriggers.vcs.git.OperationContext.wrapException(OperationContext.java:176)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:374)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentState(GitVcsSupport.java:153)
at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:95)
at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:68)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:279)
at jetbrains.vcs.api.services.impl.TestConnectionServiceProvider$1.testConnection(TestConnectionServiceProvider.java:32)
at jetbrains.vcs.server.core.impl.testConnection.TestConnectionServiceImpl.testConnection(TestConnectionServiceImpl.java:45)
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController.testConnection(TestConnectionController.java:93)
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController.test(TestConnectionController.java:64)
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController.access$000(TestConnectionController.java:22)
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController$1.testConnection(TestConnectionController.java:47)
at com.jetbrains.upsource.backend.cli.vcs.TestConnectionService.testConnection(TestConnectionService.java:30)
at com.jetbrains.upsource.backend.cli.vcs.VcsServiceRPCCommandFactory$3.execute(VcsServiceRPCCommandFactory.java:130)
at com.jetbrains.upsource.backend.cli.vcs.VcsServiceRPCCommandFactory$3.execute(VcsServiceRPCCommandFactory.java:121)
at com.jetbrains.upsource.messaging.rpc.impl.server.RpcTaskRunnable.a(RpcTaskRunnable.java:92)
at com.jetbrains.upsource.stats.StatsManager.decorateCompletableFuture(StatsManager.java:218)
at com.jetbrains.upsource.stats.StatsManager.decorateCompletableFuture(StatsManager.java:171)
at com.jetbrains.upsource.messaging.rpc.impl.server.RpcTaskRunnable.b(RpcTaskRunnable.java:91)
at com.jetbrains.upsource.messaging.rpc.impl.server.RpcTaskRunnable.run(RpcTaskRunnable.java:65)
at com.jetbrains.upsource.stats.StatsManager.a(StatsManager.java:156)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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 com.jetbrains.upsource.util.NamedDaemonThreadFactory.a(NamedDaemonThreadFactory.java:34)
at java.lang.Thread.run(Thread.java:745)

Caused by: org.eclipse.jgit.errors.TransportException: https://bitbucket.org/origofreemail/simple.git: cannot open git-upload-pack
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:566)
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:326)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:392)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:369)
... 25 more

Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:542)
at jetbrains.buildServer.buildTriggers.vcs.git.SNIHttpClientConnection$SNISSLSocketFactory.connectSocket(SNIHttpClientConnection.java:376)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at jetbrains.buildServer.buildTriggers.vcs.git.SNIHttpClientConnection.execute(SNIHttpClientConnection.java:201)
at jetbrains.buildServer.buildTriggers.vcs.git.SNIHttpClientConnection.getResponseCode(SNIHttpClientConnection.java:173)
at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:202)
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:504)
... 28 more

 

0

Try adding the same properties to the following file:

<Upsource_home_directory>/conf/upsource-frontend/upsource-frontend.jvmoptions

 

0

I'm having the same problem that Upsource fails with a connection timeout when trying to access github.com. I've tried using https and ssh, but the results stays the same. Also I've applied the changes mentioned above but it didn't change anything. On the command line you can access github.com with both ssh and https.

0

Guys who have this issue, could you please check Upsource even tries to connect to your proxy?

0

Sorry, we have destroyed that environment and started to use Upsource with direct internet connection. 

It's true we didn't check what you wrote, but I think Upsource didn't even try to connect to the proxy. 

0

Please sign in to leave a comment.