Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins now needs a "realm" for SVN. How do you find it out, and what should be entered?

Tags:

svn

jenkins

we had Jenkins setup and working perfectly. Then We upgraded the SVN module, and now it fails every other build with "revision check failed". So one build will checkout all the changes correctly, then fail with this spurious error, then the next build works.

We use externals pointing to sub directories of one repo. No actual "external" repos.

According to this bug report: https://issues.jenkins-ci.org/browse/JENKINS-21785 the solution is to create an additional "Additional Credentials" duplicating the global credentials which already work. The problem is that this needs a realm. And we don't know what the realm is. We use assembla.com.

The suggested method is to run this:

svn --no-auth-cache --config-dir invalid info proto://host:port/path/to/repo

which in our case is:

svn --no-auth-cache --config-dir invalid info https://subversion.assembla.com/svn/ourrepo/

This returns the following info:

Path: ourproject
URL: https://subversion.assembla.com/svn/ourrepo
Relative URL: ^/
Repository Root: https://subversion.assembla.com/svn/ourrepo
Repository UUID: 26850efa-2baa-4381-9140-fb0xxxxxxxxx
Revision: 1755
Node Kind: directory
Last Changed Author: me
Last Changed Rev: 1755
Last Changed Date: 2015-12-10 15:23:10 +0100 (Thu, 10 Dec 2015)

No realm info.

Now interestingly, if you try to do a checkout, and put in the wrong password, the message you get back is:

Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted

Now we assume that the string " Assembla Restricted" cant be the realm, as its contains spaces. The trouble is, we don't know what we are looking for. Is it a string? Is it a URL? We tried:

<https://subversion.assembla.com:443> Assembla Restricted

and

Assembla Restricted

and

"https://subversion.assembla.com:443"

as the realm, but these did not work

like image 734
John Little Avatar asked Dec 10 '15 15:12

John Little


People also ask

How does Jenkins integrate with SVN?

Now create a Jenkins build job. Select New Item, give the build project a name such as svn-tomcat-demo, select Maven project, and click OK. Under source code management, select Subversion and enter your SVN repository URL and credential. Please download the sample code and check the code into your SVN server.

How do I add SVN credentials to Jenkins?

Next to the Repository URL text box click the question mark. In that box will be the following text: "click this link and specify different credential". Click on that link to open the Subversion Authentication page. On that page enter the root of the repository URL, enter the login and password to use and click OK.

Can Jenkins use Subversion?

As it does for other SCM solutions, Jenkins has a dedicated plugin to support Subversion, one of the most widely used SCMs. It is part of the core release and provided by default with your Jenkins installation files.


1 Answers

I was facing the same problem. Through the discussions here I realized that the Authentication realm is a string of the form <http://path_to_svn_rep:port> Realm Name that needs to be set in Jenkins. The struggle was to find what the Realm Name was. The commands posted here to get the realm did not work for me. This is what eventually did work:

1) Search for %appdata% folder on your Windows search (usually in C:\Users\username\appdata).

2) You'll find the Subversion folder. If you don't, try accessing your repository through the web browser. This will prompt you to enter your svn credentials. After you do, you'll find the subversion folder is created in the Appdata folder.

3) Browse through the contents of /Appdata/Subversion/auth. In one of the subfolders, you'll find the file which contains some text including your SVN realm. For SlikSVN, this was /Appdata/Subversion/auth/svn.simple/someRandomName.file. Copy the WHOLE line (e.g. https://myserver:443 realmname Subversion Repository).

4) Paste it in the additional credentials section under SVN inside the Jenkins job configure page.

Hope this helps!

like image 187
Utkarsh Kajaria Avatar answered Sep 19 '22 07:09

Utkarsh Kajaria