Unable to browser remote SVN

Added by Arne De Herdt about 9 years ago

Hello,

after some struggling I managed to get redmine up and running on my fedora system at work, and we can work fine with the tickets etc.
We wish to include however the repository running on a different server.

Our Fedora machine is running on the IP 192.168.0.36 and the SVN is running on the IP 192.168.0.254
So i've tried to configure the repository settings for it in one of our projects:

SCM : Subversion
URL : https://192.168.0.254/svn/branches%209.4
Login : <myusername>
Password <mypassword>

clicked the save button, but when I visit the repository through the link in the project, I get the following error message at the top :

The entry or revision was not found in the repository.

So I decided to take a look at the error log generated by apache and found the following:

[CODE]
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/bin/passenger-spawn-server:61
...
No close tag for /lists/list
Line:
Position:
Last 80 unconsumed characters:
Output was:

<lists>
<list
path="svn://192.168.0.254/svn/CurrentRelease/C++%202007/Watch">
[/CODE]

There's more in the logfile, but I hope this is sufficient.
I tried to run the SVN command as root from the server to access the SVN and that worked fine. I got the entire XML representing the SVN repository, but it seems redmine isn't succeeding in this.

Anyone who can explain what is going wrong? I'm not an expert in Linux...
If needed i can post more logs if that helps.
Really like redmine so far, so i'd like to solve this as well.

Replies (35)

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

In the log you have pasted, svn is looking for a repository over the svn:// protocol, yet you mention https:// at the beginning of your post, make sure those are correct.

Furthermore, if you use https:// with a self-signed certificate, which is likely the case, you have to permanently accept the certificate for the user redmine runs as, as redmine shells out svn commands, and they need to be able to run without interaction. For that, log in as the user running redmine and run the svn command and accept the certificate permanently.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

I've run the command as root and accepted the certificate then, but I'm guessing redmine is not beeing ran as root...
How can I find out what user is running redmine?

I've installed apache & redmine as the root user, but I'm guessing that the user apache is running redmine?

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Arne De Herdt wrote:

I've run the command as root and accepted the certificate then, but I'm guessing redmine is not beeing ran as root...
How can I find out what user is running redmine?

I've installed apache & redmine as the root user, but I'm guessing that the user apache is running redmine?

Well, I can't answer that directly because it depends on many things, but I'll point to the right section in the passenge docs, you should be able to figure it out :-) http://modrails.com/documentation/Users%20guide%20Apache.html#PassengerUserSwitching

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

Thanks for the link,

I've read the documentation and after searching through it I found the following:

[CODE]
The owner of environment.rb must have read access to the Rails application’s folder, and read/write access to the Rails application’s logs folder. Likewise, the owner of config.ru must have read access to the Rack application’s folder.

This feature is only available if Apache is started by root. This is the case on most Apache installations.

Under no circumstances will applications be run as root. If environment.rb/config.ru is owned as root or by an unknown user, then the Rails/Rack application will run as the user specified by PassengerDefaultUser (Apache)/passenger_default_user (Nginx).
[/CODE]

So in my case the user that is running Redmine should be apache.
I'll try to login as that user and see if I can get the SVN certificate.

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Well, that happens only if PassengerUserSwitching is on, which is the default, but you should still have a quick look at your apache config. If it's set to off, then passenger switches to the user set in PassengerDefaultUser, which is nobody by default

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

checked the config files and there were no such entries, so it should be enabled by default.
I've also read through the SVN&Apache documentation and it seems I need to configure apache to autoaccept the certificate from our server.

Will take me some time to figure out, but at least I know where to search now :)

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Arne De Herdt wrote:

Will take me some time to figure out, but at least I know where to search now :)

That's the easy part: login as apache, execute svn ls https://yourserver/path/to/some_repo and permanently accept the certificate.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

yeah I know, but I need to figure out the password i've set on the apache user.....:S

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

What about su - apache (as root)? ;-)

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

yup, succeeded in that. Problem was that my apache had no shell set, well it had the nologin shell so that made things a bit more complicated.
But I managed to assign a shell to apache and could login.
I ran the svn command and accepted the certificate permenatly.

However, the repo browsing still isn't working...

Production log gives me this now:

Processing RepositoriesController#show (for 192.168.112.108 at 2010-06-11 17:27:30) [GET]
  Parameters: {"action"=>"show", "id"=>"r94", "controller"=>"repositories"}
Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list>
/usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:28:in `parse'
/usr/lib/ruby/1.8/rexml/document.rb:227:in `build'
/usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize'
/opt/redmine/lib/redmine/scm/adapters/subversion_adapter.rb:85:in `new'
/opt/redmine/lib/redmine/scm/adapters/subversion_adapter.rb:85:in `entries'
/opt/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:193:in `call'
/opt/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:193:in `shellout'
/opt/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:191:in `popen'
/opt/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:191:in `shellout'
/opt/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:177:in `shellout'
/opt/redmine/lib/redmine/scm/adapters/subversion_adapter.rb:82:in `entries'
/opt/redmine/app/models/repository.rb:63:in `entries'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:217:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:217:in `method_missing'
/opt/redmine/app/controllers/repositories_controller.rb:72:in `show'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/bin/passenger-spawn-server:61
...
No close tag for /lists/list
Line: 
Position: 
Last 80 unconsumed characters:
Output was:
 <?xml version="1.0"?>
<lists>
<list
   path="https://192.168.0.254/svn/Branches%20r9.4">
Rendering template within layouts/base
Completed in 709ms (View: 21, DB: 3) | 500 Internal Server Error [http://192.168.0.36/projects/r94/repository]

I'm guessing there's something wrong with the XML beeing returned?

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Have a look at redmine_dir/logs/SCM_output.log (or something like that).

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

no such file, there's only the production log.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

I did found this though in the redmine.log inside the apache log folder:

login as: root
root@192.168.0.36's password:
Last login: Fri Jun 11 17:19:09 2010 from 192.168.112.108
[root@puppy ~]# vim /etc/httpd/logs/redmine.log
[Fri Jun 11 15:06:38 2010] [error] [client 192.168.0.240] user admin: authentication failure for "/svn": Password Mismatch
[Fri Jun 11 15:06:46 2010] [error] [client 192.168.0.240] Could not fetch resource information.  [301, #0]
[Fri Jun 11 15:06:46 2010] [error] [client 192.168.0.240] Requests for a collection must have a trailing slash on the URI.  [301, #0]

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

No, it does try to look at https://192.168.0.254/svn/Branches%20r9.4 all right… See what the output of svn list --xml https://192.168.0.254/svn/Branches%20r9.4@HEAD --username USER --password PASSWORD --no-auth-cache --non-interactive run on the machine with redmine installed on it as the user running redmine (which you said was apache) does.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

[root@puppy ~]# su apache
bash-4.0$ svn list --xml https://192.168.0.254/svn/Branches%20r9.4@HEAD --username <username> --password <password> --no-auth-cache --non-interactive
<?xml version="1.0"?>
<lists>
<list
   path="https://192.168.0.254/svn/Branches%20r9.4">
svn: OPTIONS of 'https://192.168.0.254/svn/Branches%20r9.4': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
You have new mail in /var/spool/mail/root
bash-4.0$

Seems the certificate is beeing annoying, although i've accepted it :S

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

I'd wager apache doesn't have a home or can't write to it. Either remedy that, or change the redmine instance to another owner which has a home and everything else needed.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

I'll try giving apache a home :)

but that will be for after the weekend. Thanks for all the assistance so far Felix.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

Ok,

time to pick up the topic i'm afraid...

- I've made sure that my apache user has a home
- I'm able to run the SVN commands as the apache user in command line, the certificate is permantly accepted
- redmine still complains : The entry or revision was not found in the repository.
- error_log contains this:

svn: OPTIONS of 'https://192.168.0.254/svn/Branches%20r9.4': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn/Branches%20r9.4': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn/Branches%20r9.4': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn/Branches%20r9.4': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)
svn: OPTIONS of 'https://192.168.0.254/svn': Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted (https://192.168.0.254)

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Then redmine is not running as apache, or doesn't recognize that it has a home. Have you restarted apache (completely, not just reloaded)? Or maybe login as apache and have a look at your environment, $HOME specifically, and see if it's what you would expect? Call up any page in redmine and have look at ps aux, you should have a process called Rails: running as apache.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

it's running as 'nobody'

but that's not what the passenger documentation said......

we'll i'll repeat the steps for the nobody login and see if I can get it working.

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Felix Schäfer wrote:

Well, that happens only if PassengerUserSwitching is on, which is the default, but you should still have a quick look at your apache config. If it's set to off, then passenger switches to the user set in PassengerDefaultUser, which is nobody by default

Maybe try forcing PassengerUserSwitching on in your apache config, and if it doesn't work force PassengerDefaultUser apache. I just remembered that it works only if apache is started as root I think, and IIRC fedora has SELinux enabled, right? That might be a problem too.

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

applying your recommendation.
I've disabled SELinux...

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

ok, now I have the rails application running as apache. Said so on ps aux.

Logged in as apache, request the svn certificate by running the command:
svn list --xml https://192.168.0.254/svn

Got the question to permantly accept it, so I did. However still no dice with redmine :S

RE: Unable to browser remote SVN - Added by Felix Schäfer about 9 years ago

Arne De Herdt wrote:

ok, now I have the rails application running as apache. Said so on ps aux.

Logged in as apache, request the svn certificate by running the command:
svn list --xml https://192.168.0.254/svn

Got the question to permantly accept it, so I did. However still no dice with redmine :S

If you get the question to accept the certificate each time you login as apache, it doesn't get permanently accepted, does it? ;-)

RE: Unable to browser remote SVN - Added by Arne De Herdt about 9 years ago

seems not....
I think apache hates me :(

I have noticed this however:

the homedirectory of my apache user is set to /var/www
When I do a ls -all command, I can see that all these folders and subfolders belong to root. Shouldn't they belong to apache ?

1 2 (1-25/35)