Discussion:
Subclipse + SVNKit keeps asking for credentials when connecting through svn+ssh
Nir Lisker
2012-11-06 16:29:31 UTC
Permalink
Hello,

I'm using Subclipse to connect to an SVN repository via svn+ssh and a
private key (the server has the paired public key). The interface is SVNKit
(Pure Java). After I enter the svn+ssh://repository... address I am
prompted for credentials. I specify the username and private key file (I
did not set a passphrase so it is left blank) and confirm. The window pops
up again and this goes on indefinitely. No console message is provided.

Note 1: Marking "Save information" seems to have no effect. If there is a
cache I'm supposed to be deleting this could help. I already deleted the
keyring file in eclipse.

Note 2: I wasn't sure if the private key should be in SSH2 or OpenSSH
formats, but I tried both and there is no difference.

Note 3: I cannot find org.tmatesoft.svn folder under plugins in eclipse. I
installed SVNKit from the eclipse update site
http://eclipse.svnkit.com/1.7.x.

Specifications: Windows 7 64 bit, eclipse 4.2.1 64 bit, Subclipse 1.8.16,
Subversion client adapter 1.8.3, SVNKit client adapter 1.7.5.1.

If there is any other information or log file I should provide I would be
happy to do so.
Dmitry Pavlenko
2012-11-06 16:42:47 UTC
Permalink
Hello,

Could you try to connect to the repository with native Subversion and with "jsvn" command line
utility that is distributed together with SVNKit?
If "jsvn" behaves in the same manner as native Subversion, then it's not SVNKit issue, better
contact Subclipse plugin support. If they behave in different ways, please file an issue at
http://issues.tmatesoft.com/issues/SVNKIT.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by Nir Lisker
Hello,
I'm using Subclipse to connect to an SVN repository via svn+ssh and a
private key (the server has the paired public key). The interface is SVNKit
(Pure Java). After I enter the svn+ssh://repository... address I am
prompted for credentials. I specify the username and private key file (I
did not set a passphrase so it is left blank) and confirm. The window pops
up again and this goes on indefinitely. No console message is provided.
Note 1: Marking "Save information" seems to have no effect. If there is a
cache I'm supposed to be deleting this could help. I already deleted the
keyring file in eclipse.
Note 2: I wasn't sure if the private key should be in SSH2 or OpenSSH
formats, but I tried both and there is no difference.
Note 3: I cannot find org.tmatesoft.svn folder under plugins in eclipse. I
installed SVNKit from the eclipse update site
http://eclipse.svnkit.com/1.7.x.
Specifications: Windows 7 64 bit, eclipse 4.2.1 64 bit, Subclipse 1.8.16,
Subversion client adapter 1.8.3, SVNKit client adapter 1.7.5.1.
If there is any other information or log file I should provide I would be
happy to do so.
omega09
2012-11-06 17:07:49 UTC
Permalink
Thanks for answering,

Could you specify how do I access "jsvn" and connect with it to the
Subversion? I installed SVNKit through eclipse's plugin install interface,
so I don't know where this utility is located.



--
View this message in context: http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-credentials-when-connecting-through-svn-ssh-tp175567p175571.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.
Dmitry Pavlenko
2012-11-06 17:19:32 UTC
Permalink
You can download it from this page
http://www.svnkit.com/download

(http://www.svnkit.com/org.tmatesoft.svn_1.7.6.standalone.zip)

By connect I meant any operation with the repository, e.g. "checkout":

$ jsvn checkout <URL> path/for/working/copy


And I would ask you to run the same command with native Subversion:

$ svn checkout <URL> path/for/working/copy

and to compare their behaviour.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by omega09
Thanks for answering,
Could you specify how do I access "jsvn" and connect with it to the
Subversion? I installed SVNKit through eclipse's plugin install interface,
so I don't know where this utility is located.
--
http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-
credentials-when-connecting-through-svn-ssh-tp175567p175571.html Sent from
the SVNKit - Users mailing list archive at Nabble.com.
omega09
2012-11-06 18:27:04 UTC
Permalink
I went through the command line process. After entering the username and
private key path I am asked if I want to cache the information. Regardless
of what I choose, I am being asked again for username and so on. I take it
that the same problem is here as well.
I did not get a response from subclipse, but in other posts I read
presenting a similar problem, it says that the authentication process is
handled by SVNKit and the subclipse plugin has nothing to do with it.
I was thinking, supposed that something is actually wrong with my
credentials, would there be a message indicating it (wrong username, private
key doesn't match etc.)?
I generated my private/public key pair with SSH Secure Shell, then I
converted the format from SSH2 to Open SSH, which is what I was using.
Perhaps I'm using an inadequate procedure here?



--
View this message in context: http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-credentials-when-connecting-through-svn-ssh-tp175567p175582.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.
omega09
2012-11-08 11:29:11 UTC
Permalink
I tried to write a code to access the SVN repository:

-----------

SVNRepositoryFactoryImpl.setup();
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(new File("dir1"), "username",
"", new File("keypath"), "", false);
SVNRepository repository = null;
try {
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded("SVNurl"),
null);
} catch (SVNException e) {
e.printStackTrace();
}
repository.setAuthenticationManager(authManager);
try {
repository.testConnection();
} catch (SVNException e) {
e.printStackTrace();
}

-----------

I get the following console message:

Exception in thread "main" java.lang.NoClassDefFoundError:
com/trilead/ssh2/ServerHostKeyVerifier
at
org.tmatesoft.svn.core.internal.io.svn.ISVNConnectorFactory$1.createConnector(ISVNConnectorFactory.java:33)
at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1249)
at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:95)
at svn.Access.main(Access.java:35)
Caused by: java.lang.ClassNotFoundException:
com.trilead.ssh2.ServerHostKeyVerifier
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more

-----------

What does this indicate?



--
View this message in context: http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-credentials-when-connecting-through-svn-ssh-tp175567p175668.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.
Dmitry Pavlenko
2012-11-08 12:02:53 UTC
Permalink
Hello,
ServerHostKeyVerifier is a class from trilead library used by SVNKit. Make sure it is included into
your classpath. If you use maven to build your test project, it will download it as a dependency.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by omega09
-----------
SVNRepositoryFactoryImpl.setup();
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(new File("dir1"), "username",
"", new File("keypath"), "", false);
SVNRepository repository = null;
try {
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded("SVNurl"),
null);
} catch (SVNException e) {
e.printStackTrace();
}
repository.setAuthenticationManager(authManager);
try {
repository.testConnection();
} catch (SVNException e) {
e.printStackTrace();
}
-----------
com/trilead/ssh2/ServerHostKeyVerifier
at
org.tmatesoft.svn.core.internal.io.svn.ISVNConnectorFactory$1.createConnect
or(ISVNConnectorFactory.java:33) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVN
RepositoryImpl.java:1249) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVN
RepositoryImpl.java:95) at svn.Access.main(Access.java:35)
com.trilead.ssh2.ServerHostKeyVerifier
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
-----------
What does this indicate?
--
http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-
credentials-when-connecting-through-svn-ssh-tp175567p175668.html Sent from
the SVNKit - Users mailing list archive at Nabble.com.
omega09
2012-11-08 12:48:13 UTC
Permalink
Thank you,

I don't use Maven. Why does the compiler not alert me that a class is not
recognized? Also, Where is that library located? I added the SVNKit jar to
the classpath already so I could import all the relevant packages, do I need
to download something else?



--
View this message in context: http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-credentials-when-connecting-through-svn-ssh-tp175567p175675.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.
Dmitry Pavlenko
2012-11-08 13:14:58 UTC
Permalink
I think that the compiler doesn't alert you because you don't use trilead directly, only SVNKit uses
it. When you download SVNKit from the website

http://www.svnkit.com/org.tmatesoft.svn_1.7.6.standalone.zip

all relevant jars are in "lib" directory.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by omega09
Thank you,
I don't use Maven. Why does the compiler not alert me that a class is not
recognized? Also, Where is that library located? I added the SVNKit jar to
the classpath already so I could import all the relevant packages, do I
need to download something else?
--
http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-
credentials-when-connecting-through-svn-ssh-tp175567p175675.html Sent from
the SVNKit - Users mailing list archive at Nabble.com.
omega09
2012-11-08 13:44:32 UTC
Permalink
Alright, it's getting somewhere. I added the required jar and now when I run
the code I get the console message:

org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001:
Authentication required for 'svn+ssh://servername'
at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVNErrorManager.java:47)
at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVNErrorManager.java:41)
at
org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getNextAuthentication(DefaultSVNAuthenticationManager.java:218)
at
org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:147)
at
org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77)
at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1252)
at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:95)
at svn.Access.main(Access.java:35)

------

I provided the authentication info (username, private key) in the
authentication manager as can be seen in the code. Now what?



--
View this message in context: http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-credentials-when-connecting-through-svn-ssh-tp175567p175677.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.
Dmitry Pavlenko
2012-11-08 14:21:24 UTC
Permalink
This is not expected, if you didn't confuse credentials, the code should work. That's strange
because other SVNKit users have no problem when accessing repositories via svn+ssh.

You said that SVNKit comand line keeps asking you for credentials. Do you mean that you run "jsvn",
it asks you for credentials, then the command succeeds, and it asks you for credentials again only
when you run "jsvn" the next time
or
do you mean that the command doesn't succeed at all and it just asks and asks for credentials?

The latter case usually means that credentials were just wrong.


Did you try to connect with these credentials using native Subversion? Does it ever succeed?

If the command succeeds and just doesn't cache credentials between subsequent call, do you have a
possibility to setup a test account with a test repository on that server and test credentials in
order to let me reproduce the problem myself?

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by omega09
Alright, it's getting somewhere. I added the required jar and now when I
Authentication required for 'svn+ssh://servername'
at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVN
ErrorManager.java:47) at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVN
ErrorManager.java:41) at
org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getNextA
uthentication(DefaultSVNAuthenticationManager.java:218) at
org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector
.java:147) at
org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.jav
a:77) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVN
RepositoryImpl.java:1252) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVN
RepositoryImpl.java:95) at svn.Access.main(Access.java:35)
------
I provided the authentication info (username, private key) in the
authentication manager as can be seen in the code. Now what?
--
http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-
credentials-when-connecting-through-svn-ssh-tp175567p175677.html Sent from
the SVNKit - Users mailing list archive at Nabble.com.
Dmitry Pavlenko
2012-11-20 17:19:17 UTC
Permalink
Hello,

Looks like we've found why the problem happens, please have a look at this thread:

http://subversion.1072662.n5.nabble.com/SVNKit-within-Eclipse-not-storing-passwords-tp175926p176064.html

If this solution doesn't work for you, please comment to that thread.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Post by omega09
Alright, it's getting somewhere. I added the required jar and now when I
Authentication required for 'svn+ssh://servername'
at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVN
ErrorManager.java:47) at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVN
ErrorManager.java:41) at
org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getNextA
uthentication(DefaultSVNAuthenticationManager.java:218) at
org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector
.java:147) at
org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.jav
a:77) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVN
RepositoryImpl.java:1252) at
org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVN
RepositoryImpl.java:95) at svn.Access.main(Access.java:35)
------
I provided the authentication info (username, private key) in the
authentication manager as can be seen in the code. Now what?
--
http://subversion.1072662.n5.nabble.com/Subclipse-SVNKit-keeps-asking-for-
credentials-when-connecting-through-svn-ssh-tp175567p175677.html Sent from
the SVNKit - Users mailing list archive at Nabble.com.
Loading...