Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 66885 - [SSH2] Timeout waiting for user input should be handled differently
Summary: [SSH2] Timeout waiting for user input should be handled differently
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 80903 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-14 04:30 EDT by Dani Megert CLA
Modified: 2005-04-22 14:41 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-06-14 04:30:28 EDT
Similar bug 60104 seems to be fixed in RC2 however, I still get it in my log but
this time not from QuickDiff. It happens when synchronizing the whole workspace
the very first time. I guess the reason is that I did not enter the password
immediately (because I switched to another application).

!SESSION Jun 14, 2004 10:09:37.04 ----------------------------------------------
eclipse.buildId=I200406111814
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Command-line arguments: -update -keyring c:\eclipse\.keyring -application
org.eclipse.ui.ide.workbench -showlocation

!ENTRY org.eclipse.team.core 4 0 Jun 14, 2004 10:09:37.04
!MESSAGE Problems reported while synchronizing CVS Workspace. 48 of 49 resources
were synchronized.
!SUBENTRY 1 org.eclipse.team.core 4 0 Jun 14, 2004 10:09:37.04
!MESSAGE An error occurred synchronizing /jdt-ui-home: Authentication error:
com.jcraft.jsch.JSchException: Auth fail
!STACK 1
org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException:
Authentication error: com.jcraft.jsch.JSchException: Auth fail
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.internalOpen(CVSSSH2ServerConnection.java:151)
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.open(CVSSSH2ServerConnection.java:99)
	at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:127)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:575)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:821)
	at org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:142)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.fetchDelta(RemoteFolderTreeBuilder.java:219)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildTree(RemoteFolderTreeBuilder.java:187)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildRemoteTree(RemoteFolderTreeBuilder.java:159)
	at
org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot.getRemoteTree(CVSWorkspaceRoot.java:230)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.fetchVariant(CVSResourceVariantTree.java:100)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:94)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.refresh(CVSResourceVariantTree.java:303)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:63)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:158)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:123)
	at
org.eclipse.team.internal.ui.synchronize.RefreshSubscriberJob.run(RefreshSubscriberJob.java:279)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
!SUBENTRY 2 org.eclipse.team.cvs.core 4 2 Jun 14, 2004 10:09:37.14
!MESSAGE Authentication error: com.jcraft.jsch.JSchException: Auth fail
Comment 1 Jean-Michel Lemieux CLA 2004-06-14 10:58:31 EDT
Yes, this first time problem is documented in the other bug. It is a caching
problem.

*** This bug has been marked as a duplicate of 66595 ***
Comment 2 Dani Megert CLA 2004-06-18 08:35:47 EDT
I200406180010

!SESSION Jun 18, 2004 14:28:31.981 ---------------------------------------------
eclipse.buildId=I200406180010
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Command-line arguments: -update -keyring c:\eclipse\.keyring -application
org.eclipse.ui.ide.workbench -showlocation

!ENTRY org.eclipse.team.core 4 0 Jun 18, 2004 14:28:31.981
!MESSAGE Problems reported while synchronizing CVS Workspace. 49 of 50 resources
were synchronized.
!SUBENTRY 1 org.eclipse.team.core 4 0 Jun 18, 2004 14:28:31.981
!MESSAGE An error occurred synchronizing /jdt-ui-home: Authentication error:
com.jcraft.jsch.JSchException: Auth fail
!STACK 1
org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException:
Authentication error: com.jcraft.jsch.JSchException: Auth fail
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.internalOpen(CVSSSH2ServerConnection.java:151)
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.open(CVSSSH2ServerConnection.java:99)
	at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:127)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:575)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:821)
	at org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:142)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.fetchDelta(RemoteFolderTreeBuilder.java:219)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildTree(RemoteFolderTreeBuilder.java:187)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildRemoteTree(RemoteFolderTreeBuilder.java:159)
	at
org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot.getRemoteTree(CVSWorkspaceRoot.java:230)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.fetchVariant(CVSResourceVariantTree.java:100)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:94)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.refresh(CVSResourceVariantTree.java:303)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:63)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:158)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:123)
	at
org.eclipse.team.internal.ui.synchronize.RefreshSubscriberJob.run(RefreshSubscriberJob.java:279)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
!SUBENTRY 2 org.eclipse.team.cvs.core 4 2 Jun 18, 2004 14:28:32.211
!MESSAGE Authentication error: com.jcraft.jsch.JSchException: Auth fail
Comment 3 Jean-Michel Lemieux CLA 2004-06-18 09:03:19 EDT
This can happen and the fact that it is in the log is a side-effect that core
logs all statuses returned by a job.

The original bug was that you could enter a valid password once, then the second
time you connect to the repository you are prompted again. Did this happen, what
steps di you take. Did you connect from home and then one of the repos was not
accessible? Anything interesting about the project that failed.
Comment 4 Dani Megert CLA 2004-06-18 12:33:49 EDT
I started my normal workspace and in the Sync view I refreshed my whole
workspace. As stated in the initial comment I guess the reason is that I did not
enter the password immediately (because I switched to another application).

Aah: I do not enter the real password since I use SSH2 I have to enter a
password to my protected keyring file.
Comment 5 Jean-Michel Lemieux CLA 2004-06-24 10:54:14 EDT
I can't duplicate this. The caching problem was fixed in bug 66595. 
Comment 6 Dani Megert CLA 2004-06-24 11:59:22 EDT
Well, it does not for me and bug 66595 is still open.
Comment 7 Dani Megert CLA 2004-08-04 03:54:57 EDT
See bug 66595, comment 13.

Steps (R3.0):

1. open workspace which has 0 editors open and many CVS projects shared using
ssh2. Keyring password protected.

2. start to synchronize the whole workspace and switch to another application
(e.g. notes). IMPORTANT: do not enter the keyring password if the dialog comes
up before switching.

3. after a while (at least as big as your CVS timeout) switch back to Eclipse
and enter the keyring password.

==> synchronization starts. At the end you get an error dialog that only n-1 of
n projects have been synchronized and a log entry (see the log entry from this
morning below).

CVS should retry to synchronized the first project once the password for the
keyring has been submitted.

!SESSION Aug 04, 2004 09:36:35.88 ----------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Command-line arguments: -update -keyring c:\eclipse\.keyring -application
org.eclipse.ui.ide.workbench -showlocation

!ENTRY org.eclipse.team.core 4 0 Aug 04, 2004 09:36:35.88
!MESSAGE Problems reported while synchronizing CVS Workspace. 54 of 55 resources
were synchronized.
!SUBENTRY 1 org.eclipse.team.core 4 0 Aug 04, 2004 09:36:35.88
!MESSAGE An error occurred synchronizing /jdt-ui-home: Authentication error:
com.jcraft.jsch.JSchException: Auth fail
!STACK 1
org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException:
Authentication error: com.jcraft.jsch.JSchException: Auth fail
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.internalOpen(CVSSSH2ServerConnection.java:151)
	at
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2ServerConnection.open(CVSSSH2ServerConnection.java:99)
	at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:127)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:575)
	at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:821)
	at org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:142)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.fetchDelta(RemoteFolderTreeBuilder.java:219)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildTree(RemoteFolderTreeBuilder.java:187)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.buildRemoteTree(RemoteFolderTreeBuilder.java:159)
	at
org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot.getRemoteTree(CVSWorkspaceRoot.java:230)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.fetchVariant(CVSResourceVariantTree.java:100)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:94)
	at
org.eclipse.team.internal.ccvs.core.syncinfo.CVSResourceVariantTree.refresh(CVSResourceVariantTree.java:303)
	at
org.eclipse.team.core.variants.AbstractResourceVariantTree.refresh(AbstractResourceVariantTree.java:63)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:158)
	at
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.refresh(ResourceVariantTreeSubscriber.java:123)
	at
org.eclipse.team.internal.ui.synchronize.RefreshSubscriberJob.run(RefreshSubscriberJob.java:279)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
!SUBENTRY 2 org.eclipse.team.cvs.core 4 2 Aug 04, 2004 09:36:35.88
!MESSAGE Authentication error: com.jcraft.jsch.JSchException: Auth fail
Comment 8 Michael Valenta CLA 2004-12-16 13:35:49 EST
*** Bug 80903 has been marked as a duplicate of this bug. ***
Comment 9 Michael Valenta CLA 2004-12-17 09:30:13 EST
When this exception now occurs, the stack trace is no longer logged. This 
needs to be fixed. Having another glance at the steps to reproduce leads me to 
believe that we may have fixed the cause of this in M4 (bug 80976). Dani, 
could you keep an eye open for the log message in the M4 build and let us know 
if it is still happening for you.
Comment 10 Dani Megert CLA 2004-12-17 12:06:07 EST
Looks promising so far :-)
Comment 11 Dani Megert CLA 2004-12-21 03:03:16 EST
!SESSION 2004-12-21 08:56:37.947 -----------------------------------------------
eclipse.buildId=I20041216-2000
java.version=1.4.2_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -update -keyring c:\eclipse\.keyring -application
org.eclipse.ui.ide.workbench -showlocation
Command-line arguments:  -update -keyring c:\eclipse\.keyring -application
org.eclipse.ui.ide.workbench -showlocation -data
c:\eclipse\workspaces\Development_2_2\plugins

!ENTRY org.eclipse.team.cvs.core 4 2 2004-12-21 08:56:37.947
!MESSAGE Authentication error: An undetermined authentication failure has occurred
Comment 12 Dani Megert CLA 2004-12-21 03:29:23 EST
This is now much worse (==> setting to major), because parts of bug 81548 hit me
now as well. I have the following scenario when I startup:
- use SSH2
- specify -keyring when starting Eclipse
- Team perspective with workspace
- Java perspective (might be important: in different window)
- start Eclipse and switch do some other app
- come back after a while
==> OK: password is requested for my private key (for ssh2)
==> BAD: password for dev.eclipse.org gets asked

I say BAD because after each startup I check the checkbox to store the password
and enter the correct password. I also see that the .keyring file which I
specify on the command line gets touched. This started to happen with one of
last weeks build. I first thought it's a problem on our side since we had
several network outages last week but this week the network is fine and the
error easily reproducible (I simply wait for the timeout).
Comment 13 Dani Megert CLA 2004-12-21 03:54:26 EST
Not sure whether this is related but I run everything in background (General >
Always run in background).
Comment 14 Michael Valenta CLA 2005-03-31 16:35:06 EST
The problem is this:

1) The passphrase for a private key is never stored in the keyring
2) When connecting, the SSH2 client we use (Jsch) first connects to the server 
and then determines what authentication to use. If needed, it prompts the 
user. In your case, it prompts for the passphrase for your key.
3) You don't respond for over 60 seconds so the connection times out because 
the timeout is associated with the underlying stream.
4) You provide your passphrase and it is recorded but the operation that was 
just attempted fails.
5) The CVS plugin records the authentication failure so that it will prompt 
for a password before making the next connection to avoid password locking. 
6) Either your password (if you provided it) or the passphrase you provided 
allow future operations to succeed.
7) So, as you have witnessed, you end up with one failed project in 
synchronize.

Possible solutions that come to mind:

A. Make the underlying stream aware of the prompt and delay timing out by some 
reasonable amount. We couldn't wait forever though as this would tie up server 
resources.

B. Detect the timeout and retry the connection once the user has provided the 
requested information.

I'll need to investigate the potential of these two solutions given the shape 
of the SSH2 code. I think I prefer option 2.
Comment 15 Michael Valenta CLA 2005-04-04 11:55:21 EDT
I have modified the SSH2 client to retry if a connection failure occurs after 
a prompt has been open for longer than the CVS timeout (option 2 above)
Comment 16 Dani Megert CLA 2005-04-13 03:30:22 EDT
See bug 90766, comment 2. It seems that this bug was fixed for I20050405-0800
and then brought back again.
Comment 17 Michael Valenta CLA 2005-04-22 14:41:37 EDT
Reclosing as fixed since this particular error is no longer happening. We will 
continue the investigation in bug 90766.