Getting "Connection timed out: connect" when trying to use 'Remote Run' over proxy/SSL

Hi.

I'm trying to use Remote Run with a Team City 4.5, from a IntelliJ 8 (tried both 8, 8.1.1 EAP), but cannot get it to work. I'm using SSL, a web-proxy and the TeamCity server is running at our hosting firm.

I'm able to login to the TeamCity OK, it seems it just the 'Remote Run' feature not working.

Anybody got any clues what the problem might be ? I suspect something with the SLL/Proxy combo...

Here's the exception I get in the logs:

java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:394)
    at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:123)
    at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82)
    at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at jetbrains.buildServer.delayedCommit.DelayedCommitCommitSession.sendToServer(DelayedCommitCommitSession.java:373)
    at jetbrains.buildServer.delayedCommit.DelayedCommitCommitSession.sendChanges(DelayedCommitCommitSession.java:340)
    at jetbrains.buildServer.delayedCommit.DelayedCommitCommitSession.execute(DelayedCommitCommitSession.java:175)
    at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog$4$1.run(CommitChangeListDialog.java:1)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:1)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:3)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$4.run(ProgressManagerImpl.java:1)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:5)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:13)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:101)
    at com.intellij.openapi.application.impl.ApplicationImpl$7$1.run(ApplicationImpl.java:3)
    at com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:8)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:5)

20 comments
Comment actions Permalink

Hello Fredrik,

   Does your hosted SSL TeamCity server has a valid signed certificate? If this is not the case, you'll have to import certificate to your local keystore (see the first part of this article).

   Regards,
   KIR

0
Comment actions Permalink

Hi Kir.

Yes, it is a valid Thawte certificate. (First we only had a self-signed one, but then I couldn't even log in to the TC server).


//Fredrik

0
Comment actions Permalink

Hello,

  What version of Java do you use to start IDEA? Could you probably upgrade to the latest version?
  I'm asking because of the following: http://forums.sun.com/thread.jspa?threadID=5348465

  Regards,
  KIR

0
Comment actions Permalink

Updated to 1.6.0_13 , unfortunately the problem remains.

I enable debug-logging on 'org.apache.commons.httpclient' and 'httpclient.wire' to try to see more.

It seems like the TC plugin login and poll threads use the proxy, generating logs like these:

2009-04-27 16:08:41,993 DEBUG pool-2-thread-1 [HttpConnection] Open connection to <proxy server>:8080
2009-04-27 16:08:41,997 DEBUG pool-2-thread-1 [ConnectMethod] enter ConnectMethod.execute(HttpState, HttpConnection)
2009-04-27 16:08:41,998 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.execute(HttpState, HttpConnection)
2009-04-27 16:08:41,998 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.writeRequest(HttpState, HttpConnection)
2009-04-27 16:08:41,999 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.printLine(String)
2009-04-27 16:08:41,999 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.writeLine(byte[])
2009-04-27 16:08:41,999 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.write(byte[])
2009-04-27 16:08:42,000 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.write(byte[], int, int)
2009-04-27 16:08:42,001 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.writeLine()
2009-04-27 16:08:42,001 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.write(byte[])
2009-04-27 16:08:42,002 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.write(byte[], int, int)
2009-04-27 16:08:42,002 DEBUG pool-2-thread-1 [header] >> "CONNECT ipxdev.ipx.com:443 HTTP/1.1"
[...]
2009-04-27 16:08:38,670 DEBUG pool-2-thread-1 [ConnectMethod] CONNECT status code 200
2009-04-27 16:08:38,671 DEBUG pool-2-thread-1 [HttpConnection] enter HttpConnection.tunnelCreated()
2009-04-27 16:08:38,671 DEBUG pool-2-thread-1 [HttpConnection] Secure tunnel to <removed server>:443
2009-04-27 16:08:40,153 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.execute(HttpState, HttpConnection)
2009-04-27 16:08:40,159 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.writeRequest(HttpState, HttpConnection)
2009-04-27 16:08:40,159 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
2009-04-27 16:08:40,160 DEBUG pool-2-thread-1 [HttpMethodBase] enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)
2009-04-27 16:08:40,161 DEBUG pool-2-thread-1 [header] >> "POST /teamcity/RPC2 HTTP/1.1[\r][\n]"


While it seems the thread trying to do the Remote Run just tries to open connection to the server directly, using no proxy:


2009-04-27 16:09:05,334 DEBUG ApplicationImpl pooled thread [HttpConnection] enter HttpConnection.open()
2009-04-27 16:09:05,335 DEBUG ApplicationImpl pooled thread [HttpConnection] Open connection to  <removed server>:443
[...]
2009-04-27 16:09:26,334 DEBUG ApplicationImpl pooled thread [HttpConnection] enter HttpConnection.closeSockedAndStreams()
2009-04-27 16:09:26,389 INFO  ApplicationImpl pooled thread [DelayedCommitCommitSession] Connection timed out: connect
java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)


Seems like that 2 functions use different code ?

Update: Used WireShark to snoop network traffic during a 'Remote Run' try, and it did try to send packets directly to the SSL port of the dev server,  i.e. not through the proxy. So it does not pick up the configured proxy settings.

//Regads, Fredrik

0
Comment actions Permalink

Hello Fredrik,

  Looks like this is a real bug . I've filed it as TW-8102, please watch.

  Sorry for that,
  KIR

0
Comment actions Permalink

OK, thanks for the help. (Phew, not me being stupid then )

Will monitor the bug, and can also help with verifying the fix.


//Fredrik

0
Comment actions Permalink

Hello Fredrik,

  The issue was fixed, and the updated IDEA plugin is available (attached to the issue).

  Regards,
  KIR

0
Comment actions Permalink

Hello,

Seems I fixed this bug. You can find patched TeamCity plugin for IDEA in the tracker (see link to the issue above).

If you want to try it, see http://www.jetbrains.net/confluence/display/TCD4/IntelliJ+IDEA+Plugin for information about how to install IDEA plugin manually.

0
Comment actions Permalink

Hi.

I tried to install it manually (using Intellij EAP 9825), but cannot get it to work. The TeamCity menu doesn't show up in IntelliJ and no warnings/errors in the logs.

Just to make sure I tried also to manually install the plugin downloaded from the TC server, and that worked.

So seem to be something not working with the plugin you sent.. Is there any debug logs I should enable to see more ?

//Regards Fredrik

0
Comment actions Permalink

Trying again. :-)

---

Hi.


I tried to install it manually (using Intellij EAP 9825), but cannot get it to work. The TeamCity menu doesn't show up in IntelliJ and no warnings/errors in the logs.


Just to make sure I tried also to manually install the plugin downloaded from the TC server, and that worked.


So seem to be something not working with the plugin you sent.. Is there any debug logs I should enable to see more ?


//Regards Fredrik

0
Comment actions Permalink

Hello,

Sorry for the delay in replying. Can you please provide me your IDEA log? You can find it at "<User home directory>\.IntelliJIdea8x\log\idea.log".

0
Comment actions Permalink

Hi.

Here it is.

But there's no warnings or errors in in though.

Let me know if you want me to enable debug-logging for any component.


//Fredrik



Attachment(s):
idea.log
0
Comment actions Permalink

It seems that this log file contains only today timestamps. Are there any files like"<User home directory>\.IntelliJIdea8x\log\idea.log.x" that contains the timestamps of the time you installed the plugin? If there are no such files, can you please try to install the plugin again and then send me the logs with the corresponding timestamps?

0
Comment actions Permalink

Hi.

It is the logs from an install. This is what I did:

1. Checked no other TeamCity plugin was installed.
2. Installed the bug-fixed TC plugin, as described on the page: http://www.jetbrains.net/confluence/display/TCD4/IntelliJ+IDEA+Plugin
3. Cleared the log file.
4. Started IntelliJ and a project. (And saw that no TC meny was present, i.e. plugin not working)
5. Sent the log file to you.

Was this wrong ? Is there anything else I should do?

//Regards Fredrik

0
Comment actions Permalink

Hi again.

I've now tried nstalling  the 4.5.1 version of TeamCity (which includes the bug fix according to release notes)

I have then tried both on my computer and a co-workers, but we still get the "Connection timed out: connect" error!

Also i discovered a "new timeout issue": If you have an old version of the TeamcCity plugin, and connect to e.g. TeamCity 4.5.1 - it suggests that you update it. And if you choose to update it, the plugin installation also fails after some tome with the same "Connection timed out: connect" error.

I'd like to point out again that we're using https, maybe that is what still is causing the problem ?

//Regards Fredrik.

0
Comment actions Permalink

Hello,

Can you please try to connect using http? Does the error appear in this case?

0
Comment actions Permalink

Hi.

OK, tried with just plain http - still doesn't work using TC plugin v. 4.0.0.8975. Same error.

In the network snoops I did with Wireshark, I still see network traffic trying to connect directly to the TC server address (i.e. not using the proxy).


//Fredrik

0
Comment actions Permalink

Fredrik,

I've reopened the issue which addresses this.

Pleae watch it to be notified on updates.

--
Best regards,

Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Fredrik,

Sorry, seems this fix was not integrated to TC 4.5.1.
I fixed it and attached a new plugin to the issue in tracker: http://www.jetbrains.net/tracker/issue/TW-8102. Please try to install it.

0
Comment actions Permalink

Hi.

In my inital tests it seems to work! :-)

Will try to get back to you when I have tried more.


//F

0

Please sign in to leave a comment.