The entry or revision was not found in the repository (SOLVED)

Added by Alexander Kirillov about 7 years ago

When I try to view differences for a revision which includes a file with a non-ASCII name I get this error:

The entry or revision was not found in the repository.

Redmine is started via dispatch.fcgi and the problem is that it runs svn diff in a wrong locale:

# cat log/production.scm.stderr.log
svn: Can't convert string from 'UTF-8' to native encoding:

The issue I'm having is closely related to:

I have correct locale set for fcgid scripts but it doesn't solve the issue:

# cat /etc/httpd/conf.d/fcgid.conf
FcgidInitialEnv LANG "ru_RU.UTF-8" 

The straightforward hack works:

--- lib/redmine/scm/adapters/subversion_adapter.rb.20150331    2015-03-31 14:18:00.006294547 +0300
+++ lib/redmine/scm/adapters/subversion_adapter.rb.20150427    2015-04-27 11:44:58.518643608 +0300
@@ -205,7 +205,7 @@

           identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1)

-          cmd = "#{self.class.sq_bin} diff -r " 
+          cmd = "LANG=ru_RU.UTF-8 #{self.class.sq_bin} diff -r " 
           cmd << "#{identifier_to}:" 
           cmd << "#{identifier_from}" 
           cmd << " #{target(path)}@#{identifier_from}" 

But there should be an easier way.
I don't speak much ruby :(

# RAILS_ENV=production script/about
sh: darcs: command not found
sh: hg: command not found
sh: bzr: command not found
  Redmine version                2.6.1.stable
  Ruby version                   1.8.7-p374 (2013-06-27) [x86_64-linux]
  Rails version                  3.2.21
  Environment                    production
  Database adapter               MySQL
  Subversion                     1.6.11
  Git                            1.7.1
Redmine plugins:
  no plugin installed

Please advise,


Most of the info provided above is irrelevant. I have SuexecUserGroup redmine redmine in the virtual host configuration and the culprit is suexec which only allows environment variables from its hardcoded safe list. The simple workaround is to add

ENV['LANG']="ru_RU.UTF-8" or whatever locale you need

to config/additional_environment.rb