Project

General

Profile

Problem accessing secure SVN after upgrade

Added by Jorge Cabrera over 13 years ago

Hi,

I linked a few secure svn repositories (https) to different projects on Redmine 1.1.2 following the technique of storing the repository's public key in a file and then changing in the file subversion_adapter.rb the line SVN_BIN to something like this:

SVN_BIN = "svn --config-dir /home/<redmine_user>/.subversion_www" 

It was working great until I upgraded to Redmine 1.2. Now I have the same problem than before so I modified subversion_adapter.rb again and replaced:

SVN_BIN = Redmine::Configuration['scm_subversion_command'] || "svn" 

with

SVN_BIN = "svn --config-dir /home/<redmine_user>/.subversion_www" 

but I still get the same error when accessing the repositories:

The entry or revision was not found in the repository.

and Apache's log file shows this error:

sh: svn --config-dir /home/sistemas/.subversion_www: not found

It's not even a command not found. It's a not found. I'm very confused here, is there another way to use a https svn repository in this new version of Redmine? Can some one please help me?


Replies (5)

RE: Problem accessing secure SVN after upgrade - Added by Jorge Cabrera over 13 years ago

By the way, I get the same error if I put svn's full path:

sh: /usr/bin/svn --config-dir /home/sistemas/.subversion_www: not found

Thank you for your help

RE: Problem accessing secure SVN after upgrade - Added by Arnaud Martel over 13 years ago

I think that, now, you have to edit config/configuration.yml. For example, I use:

production:
   email_delivery:
     delivery_method: :smtp
     smtp_settings:
       address: "mx.domain.fr" 
       port: 25
       domain: "domain.fr" 
   attachments_storage_path: /var/lib/redmine
   scm_subversion_command: svn --config-dir /var/www/rails/redmine/svn

RE: Problem accessing secure SVN after upgrade - Added by R Sonnenberg about 12 years ago

Even though this thread is fairly old, I just spent two hours trying to fix this. So I thought I'd share my findings (which I haven't been able to find anywhere else yet).

I was having the same problem, where I needed to use an alternative svn config-dir in order for the www-data (apache) user to permanently accept my self-signed certificate (I did not want to use the /var/www apache home folder). When I provided the config-dir in the configuration.yml (using scm_subversion_command), I kept getting error messages stating:

sh: 'svn --config-dir /path/to/svnconfig' not found

After a review of the code in Redmine.pm, I noticed that the entire command provided in [scm_subversion_command] has shell quotes added in Redmine.pm, thus making it impossible to find the svn command, because it assumes the --config-dir is part of the command name. Even the other solution (which worked on older Redmine installations for me before) to add the --config-dir parameter to the SVN_BIN variable failed to work, since the quotes are added afterwards.

Therefore, the only solution that really worked for me was the following; On line 35 (of the original Redmine.pm shipped with version 1.3.2 from the Ubuntu 12.04 repo), replace:

@sq_bin ||= shell_quote_command

with

@sq_bin ||= shell_quote_command << " --config-dir /usr/share/redmine/svn"

This ensures that the parameter is added to all subversion commands and that it still allows usage of the [scm_subversion_command] option. I'll file a bug-report/feature-request for a more permanent solution (found here #12114), as the documentation of configuration.yml clearly states that only the full path to the executable should be used.

Hope this is helpful to others as well!

RE: Problem accessing secure SVN after upgrade - Added by Михаил Галац almost 8 years ago

I had this error when I redefined the PATH
I set the correct value, and it was all was normal.

RE: Problem accessing secure SVN after upgrade - Added by Anton Sergeev over 7 years ago

Here is solution without code modification (unix-only):
  1. Create bash-wrapper like this (suppose here /usr/share/redmine/svn_redmine.sh):
    #!/bin/bash
    svn --config-dir /usr/share/redmine/svn "$@" 
    
  2. And then point to this wrapper in config/configuration.yml:
    production:
       scm_subversion_command: /usr/share/redmine/svn_redmine.sh
    
    (1-5/5)