วันพุธ, พฤศจิกายน 21, 2555

Fixed : Jenkins SVN plugin always throw No credential to try. Authentication failed

I'm Using Jenkins 1.466.2 with Subversion plugins. Config it to always checkout the source code to build every day. One day it cannot build and show this error in the Source Code Management session.

ERROR: Failed to tag org.tmatesoft.svn.core.SVNCancelException: svn: No credential to try. Authentication failed

No matter how I try to enter the correct credential, by click the follow suggest link "Maybe you need to enter credential?" 

 Solution: 

    Got a clue from these post 

  1. http://stackoverflow.com/a/4652362.
  2. http://blog.vinodsingh.com/2009/08/hudson-svn-authentication-cancelled.html 


    I dig in to my .subversion folder; it's in your home directory. 
1.
This is my ~/.subversion/servers file; the configuration that different than the default one is this line.

...
store-plaintext-passwords = yes
...
2.

I found a file 550564593bc22e0166f1d522f51755cc under ~/.subversion/auth/svn.simple/
   I look into its content
$cat ~/.subversion/auth/svn.simple/550564593bc22e0166f1d522f51755cc
K 15
svn:realmstring
V 103
<http://filexchange.{cannot exposed}.com:80> {cannot exposed} System 2.0 Repository Login
K 8
username
V 6
dahoba
END

There's password missing?, I thought. So, I try remove the file 550564593bc22e0166f1d522f51755cc and then try to checkout by command line again
$svn --username dahoba co http://filexchange.cannot-exposed.com/svn/2.0/main/program/trunk/app.web .

It will ask for password again, input the correct password and I choose to kept plain password. If we check the content of a file again, the file 550564593bc22e0166f1d522f51755cc was re-generated.
$cat ~/.subversion/auth/svn.simple/550564593bc22e0166f1d522f51755cc
K 8
passtype
V 6
simple
K 8
password
V 9
rm$pdc124
K 15
svn:realmstring
V 103
<http://filexchange.{cannot exposed}.com:80> {cannot exposed} System 2.0 Repository Login
K 8
username
V 6
dahoba
END

    Now, back to Jenkins web console, navigate to jobs configuration, the problem should now gone.

PS: Jenkins deployed on a Ubuntu server
PS: username, servername, repository name was changed, I cannot expose those information to public.