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

10,246

Solution 1

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!

Solution 2

The answer is as follows. When you run any svn command, you get back something like this:

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

The ream is not "Assembla Restricted", nor is it the whole string, as many examples show, it is just the first part, in the case of assembla it is this:

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

Including the angle brackets.

For Assembla at least, it is the same as the repository URL, but with brackets around it and minus the path.

Solution 3

We are having the same issue here and after some searching I found the following:

We are using visual svn server (windows implementation of svn server). When we use the command specified by jenkins, we also didn't get that realm info. So after logging in with rdp on the visual svn server, I checked the C:\Program Files (x86)\VisualSVN Server\conf\httpd.conf

There I found the following setting:

AuthName "VisualSVN Server"

So when I transformed the format

<proto://server:port> SvnRealmName

into this:

<https://pathtomyserver.com:443> VisualSVN Server

it started working, hopefully it will help someone else ;)

Share:
10,246
John Little
Author by

John Little

[email protected]

Updated on July 25, 2022

Comments

  • John Little
    John Little almost 2 years

    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

  • shawn1874
    shawn1874 about 6 years
    So you are saying that VisualSVN Server is part of the realm that you enter as the realm into Jenkins? Based on the many answers posted it still isn't clear to me what I should paste into the Jenkins window that asks for the realm. Is it the entire line, <pathtomyserver.com:443> VisualSVN Server
  • shawn1874
    shawn1874 about 6 years
    They key information is about copying the WHOLE line. The other answer suggesting that only the URL part and the brackets should be used is wrong.
  • shawn1874
    shawn1874 about 6 years
    Ok. No need to reply. Your suggestion worked for me. In my case, it was everything after the colon including the number that looks like some kind of hash or ID : <svn://subversion.xxxxxxx.com:3690> 3979ca12-688d-6e4e-a6cd-e8fb00dcf214
  • user3083324
    user3083324 about 4 years
    What if the operating is a Linux distribution?