You are here:Home»KB»Programming»General»Redmine»404 - The entry or revision was not found in the repository
Sunday, 21 June 2015 17:00

404 - The entry or revision was not found in the repository

Written by

Scenario

You have trired adding your SVN repository into your Redmine project and you get the follwing error when you try browsing the repository.

404 The entry or revision was not found in the repository

404 the entry or revision was not found in the repository error message

  • You have set up your SVN repository in your subversion server and verified it works
  • You are running your Subversion server using the https:// protocol
  • You have clarified all of the settings in Redmine and all appears correct.
  • Redmine is running as a windows service
  • These instructions also assume that your Redmine/Subversion/NetBeans setup has been installed using my tutorials. It is not mandatory but they might make more sense with file paths.

Causes

Althought my instructions are geared towards my own setup of Redmine, Subversion and Netbeans all running on windows these solutions might work for other setups including remote Subversion servers.

If you are getting an "404 - the entry or revision was not found in the repository" error, it may be due to an invalid certificate. When we use svn (via https) in small businesses, we tend to use self-signed certificates but subversion client doesn't trust those by default. So you have to add exceptions to the ones you trust.

  • Invalid SSL Certificate
  • Expired SSL Certificate
  • Untrusted or Self-Signed SSL Certificate
  • Permissions on the Redmine service are no good
  • Incorrect username and password entered in to Redmine
  • There are no entries or revisions in the repository to show

Solutions

Run Redmine from the Command Console

If you run redmine from the command line (not as administrator), this runs Redmine as the currently logged in user and because of that, uses that user's Subversion SSL store and correctely handles the 'non-verified' SSL certificate if that certificate is in the current user's Subversion SSL Store

  • open a command prompt (not as administrator)
  • navigate to your redmine directory
  • run redmine by running the following command
    rails server -e production

You should find that you can now browse your reopsitory through redmine. If this works it also proves that the permissions are wrong in the redmine windows service. Although it does not directly fix the issue when running Redmine as a windows service it is a quick work around and a useful tool for testing.

Change the Redmine Windows Service Credentials

This solution worked for me.

My instructions when setting up 'Redmine as a Windows Service' configure the service to use the windows system account. This causes problems with Untrusted SSL Certificates (non-verified) because the windows system account does not have a Subversion SSL store to hold an exception and when the untrusted SSL is used this causes the Subversion binary to fail.

The solution is very easy. You need to edit the Windows Redmine Service and change the 'Log On' User. I would not use an admin account for security reasons.

  • Right click on 'My Computer'
  • Goto Services
  • Right Click on 'Redmine Windows Service' and select properties
  • Goto the 'Log On' Tab
  • Select 'Log on as:'/'This Account'
    • Enter your current user account details.
    • You can use browse to find your user account
    • If your user account does not have a password you will need to add one before you can go any further
    • It should look like this when you are done
      redmine windows service properties
  • Click apply and make sure the changes are applied
  • Click OK

If you Redmine Windows Service is running, you need to stop and start it for these changes to be applied. I am also not sure if this will cause any issues with not running aas the system account.

Invalid, Expired, Untrusted or Self-Signed Certificate (non-verified)

Redmine utilises the Subversion Client Binary. This binary will not work correctly if called by Redmine when it comes across a 'non-verified' SSL certificate and no exceptions have been made for this SSL certificate.. The connection will fail and you will get the error above. So to fix this we need to add the 'non-verified' SSL to our Subversion SSL store.

  • open a command prompt (not as administrator)
  • enter the following command to access your repository
    svn list --xml "https://svn.quantumwarp.com:18080/svn/MyITCRM"@HEAD
    This will access your Subversion repository in an interactive mode and prompt you with questions if required
  • If the target repository's SSL certificate is  'non-verified' SSL you will get prompted with the following:
    the certificate is not issued by a trusted authority
  • Press 'P' for permanent and then click enter
  • The binary will add the certificate to your Subversion SSL store to allow an exception to be made.
    A file with a Hash for a name will be created in the folder below (assuming Windows 7)
    C:\Users\shoulders\AppData\Roaming\Subversion\auth\svn.ssl.server
  • After the certificate and connection has been establish you might be prompted for a username and password. These are the username and password for the repository. You can enter them and allow the repository to be listed for you or you can cancell out as it is not needed to fix this issue.

Or

Another solution is just to use a Trusted SSL certificate.

Other Solutions

These solutions might not work and could be out of date. They are here so you know about them if the solutions above do not work.

  • adding --trust-server-cert into <redmine root="">/lib/redmine/scm/adapters/subversion_adapter.rb
  • issuing new certificate with Common Name (CN) equal to server name. (click here)
  • change SVN_BIN = "svn" into SVN_BIN = "svn --trust-server-cert --tolerant-ssl --non-interactive --config-dir /tmp" - In "lib/redmine/scm/adapters/subversion_adapter.rb"

Notes

General

  • Don’t forget that if you have(‘administration/settings/repositories/’Fetch commits automatically’) unticked (i.e. off), Redmine will not automatically bring up the revisions etc.. until you run a commit with a functioning hook that calls Redmine. (you could manually run the URL triggers to run the update). This setting is mainly for when you are testing and setting up the SCM interaction

SSL Stores

Netbeans, Subversion and SubversionEdge all have their own SSL stores as shown below.

  • C:\Users\shoulders\AppData\Roaming\Subversion\auth\svn.ssl.server
  • C:\Users\shoulders\AppData\Roaming\NetBeans\8.0.2\config\svn\config\auth\svn.ssl.server
  • D:\Documents\Developer\SubversionEdge\data\svn_client_config\auth\svn.ssl.server

If you open a command prompt elevated to an administrator and run the Subversion binary, when you accept the certificate permanently the certificates will be stored in that accounts Subversion SSL store and not your currently logged in user's Subversion SSL store.

  • The certificate names are the hash of the SSL
  • Deleting the appropriate file from the SSL Store will remove the trusted status for that SSL certificate for that piece of software
  • You can possibly move the files from one folder to another to have the same affect as accepting them permanently as they seem the same file in both of the subversion and netbeans folders.
  • Having the certificate present in
    C:\Users\shoulders\AppData\Roaming\Subversion\auth\svn.ssl.server
    does not on its own fix the connection issue in redmine. The cert file is only created in here when you accept the fix permanently.
  • only the webserver process user is finally the user for the remote svn access.
    http://www.redmine.org/boards/2/topics/28422?r=32903#message-32903
  • The Redmine servers(Thin for versions > 2.0] by default run under the System account and this does not work wrong SSL certificate for SVN server. The solution is to change the process account for a service user with logon privilege, connect to SVN and accept permanently the certificate for that user. Don't forget to change the user for the two Thin or Mongrel services running in load balancing.
    https://www.redmine.org/projects/redmine/wiki/Error_parsing_svn_output
    I think what is saying don’t run the service under a system account but use a proper logon details
  • This issue can be is caused by running redmine under the system account and this does not use your certificate store of the logged in account.

Links

Read 3205 times Last modified on Sunday, 21 June 2015 19:46