NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 565394 - Timeout 120000ms ssh git bitbucket
Summary: Timeout 120000ms ssh git bitbucket
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 5.9   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-21 08:43 EDT by Marcel Geprägs CLA
Modified: 2020-08-10 05:01 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Geprägs CLA 2020-07-21 08:43:16 EDT
If i start eclipse 2020-06 and i would like to clone, pull, push, ... from a bitbucket remote repository via ssh i get a timeout error after 120sec. 

On a second try it works without any problems!! Only on the first time since i start eclipse i have this problem!

On Eclipse 2018-05 i don't have this problem!

Can help me everybody???
Comment 1 Matthias Sohn CLA 2020-07-21 09:21:53 EDT
you can try to increase the connection timeout under
Preferences > Team > Git
though the default is 30 seconds
Comment 2 Marcel Geprägs CLA 2020-07-21 09:38:29 EDT
why i have to wait 120 seconds?

I found a solution that works. I set the ssh client from Apache MINA sshd to JSch. (Window->Preferences->Team->Git->SSH client)
Comment 3 Matthias Sohn CLA 2020-07-21 09:55:02 EDT
looks like there is some internal timeout in mina sshd
Comment 4 Thomas Wolf CLA 2020-07-21 10:29:48 EDT
That would most likely be the default timeout waiting for successful authentication; see SshdSession.connect().

I had left that one unchanged because it's not clear to me how this time is counted. It seems to keep on counting even when a passphrase dialog for an encrypted ssh key is popped up.

Basically this means SSH authentication did not complete within two minutes. Since it apparently just hangs for that time, it looks as if sshd 2.4.0 somehow gets stuck somewhere during the authentication protocol.

But without further info there's nothing I can do.

Things that I'd need:

* jstack dump including locks (jstack -l <pid>) taken during those 120 seconds,
  say after 60 or 90 seconds.
* debug log output from running the JGit command-line client to clone a repo
  from that server, with option --ssh apache. For how to run that client with
  debug logging enabled, see bug 545920 comment 5.
* if it works with the JGit command-line client but not in Eclipse, a debug log
  from an Eclipse run where the only actions are starting Eclipse, trying to
  fetch from a repo form that server, quitting eclipse. Should be possible to
  capture such a log via the same mechanism (launching eclipse from the command
  line), though I've never tried.
Comment 5 Thomas Wolf CLA 2020-08-03 10:07:41 EDT
Actually, I found the cause for this. Can reproduce locally with running ApacheSshTest.testHugePreamble() fairly consistently. Doesn't occur always, though.

This is a race condition in Apache MINA sshd 2.4.0. Not sure if it existed before. If an exception occurs very early in the SSH connection setup, it's possible that this exception is lost, and when then later on we do the authentication and wait of the future returned, that future is never notified
of the exception, and we wait for the full 120 seconds.
Comment 6 Eclipse Genie CLA 2020-08-03 10:27:50 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/167183
Comment 7 Thomas Wolf CLA 2020-08-03 17:45:56 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/167183

Not sure this work-around is good for all cases. It does reliably fix the instance I could observe in tests.

Issue reported upstream as SSHD-1050.[1]

[1] https://issues.apache.org/jira/projects/SSHD/issues/SSHD-1050
Comment 8 Thomas Wolf CLA 2020-08-04 16:31:01 EDT
(In reply to Thomas Wolf from comment #7)
> (In reply to Eclipse Genie from comment #6)
> > New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/167183
> 
> Not sure this work-around is good for all cases.

Updated the change with a general solution.