Subversion Auth does't work

Added by Giovanna Ratini about 12 years ago

Hello,
I installed redmine (0.9.5-1).
I try to integrate my subversion.
When I click on Repository I recive: "The entry or revision was not found in the repository".

Apache logs:
- testuser [02/Aug/2010:11:36:41 +0200] "OPTIONS /repos HTTP/1.1" 401 677 "-" "SVN/1.6.12 (r955767) neon/0.29.3"

Postgres log:
2010-08-02 11:35:05 CEST DEBUG: StartTransactionCommand
2010-08-02 11:35:05 CEST ANWEISUNG: SELECT * FROM "users" WHERE ("users"."id" = 1) AND (users.status = 1) AND ( ("users"."type" = 'User' OR "users"."type" = 'AnonymousUser' ) )

...

71161 2010-08-02 15:45:23 CEST LOG:  Ausführen dbdpg_p18117_1: SELECT hashed_password, auth_source_id, permissions FROM members, projects, users,roles, member_roles WHERE projects.id=members.project_id AND member_roles.member_id=members.id AND users.id=members.user_id AND roles.id=member_roles.role_id AND users.status=1 AND login=$1 AND identifier=$2
In my Virtual host
<Location /repos>
DAV svn
SVNPath "/var/lib/svn/repositories/one"
Order deny,allow
Deny from all
  1. Satisfy any
  2. AuthUserFile /etc/apache2/dav_svn.passwd
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
AuthType Basic
AuthName "Subversion Repository"
  1. read access
    <Limit GET PROPFIND OPTIONS REPORT>
    Require valid-user
    Allow from myip # Allow from another-ip
  2. Satisfy any
    </Limit>
  3. write access
    <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
    </LimitExcept>
    1. for postgres
      RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost"
      RedmineDbUser "redmine"
      RedmineDbPass "password"

</Location>

Help :)!
Thanks in advance

Gio

Replies (15)

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

  1. Please use < pre> < /pre> tags (without the obvious spaces left in there) when pasting stuff so that it's readable,
  2. You must point SVNPath to the directory containing the subversion repositories, not to one particular repository.

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Thanks :) but it does't work.


<Location /repos>
  DAV svn
  SVNPath "/var/lib/svn/repositories" 
  Order deny,allow
  Deny from all
#  Satisfy any

     PerlAccessHandler Apache::Authn::Redmine::access_handler
     PerlAuthenHandler Apache::Authn::Redmine::authen_handler

  AuthType Basic
  AuthName "Subversion Repository" 
  AuthUserFile /etc/apache2/dav_svn.passwd

# read access
    <Limit GET PROPFIND OPTIONS REPORT>
       Require valid-user
       Allow from myip
       # Allow from another-ip
#        Satisfy any
    </Limit>
# write access
    <LimitExcept GET PROPFIND OPTIONS REPORT>
      Require valid-user
    </LimitExcept>

 ## for postgres
     RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost" 
     RedmineDbUser "redmine" 
     RedmineDbPass "password" 

</Location>

 - testuser [02/Aug/2010:16:43:28 +0200] "OPTIONS /repos HTTP/1.1" 401 677 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

You obviously also need to change "myip" to the IP redmine will actually make the requests from… If both are on the same server, I'd strongly suggest making redmine access the repositories over file:// rather than http://

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Hello Felix,
I change the IP on myip and RedmineDbPass "password"
only for this forum.
I don't undestand why apache don't authorize my redmine user "testuser".
:(

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

Oh, sorry, I thought you were trying to make redmine access the repos. Make sure the user "testuser" has the permission to view the project's repository in redmine, and make sure the repository has the same name as the project's identifier. You won't be able to access the root of the repositories either (in your case "yourhost.com/repos"), because the authentication+authorization handler Redmine.pm has no way to show only the ones the user is allowed to see.

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

:(
it doesn't want :(
I create a new Project with the name of repository als Identifier testuser is a manager
of project but I revice 401 :(.

 testuser [02/Aug/2010:19:27:53 +0200] "OPTIONS /new HTTP/1.1" 401 677 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 

Looks like the Redmine.pm doesn't sent ok to apache.

Thanks,
Gio

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

Still not the right path: you have your whole definition in a <Location "repos"> block, so the URLs to your svn repositories will be yourhost.com/repos/reponame, and reponame must match a project identifier in your redmine, and testuser must have a role with at least repository read access.

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Sorry, but I'm not sure to understand .
I think now is all ok ... or?

New Projct Identifier = bam
url in Repository myhost.com/repos/bam
testuser role = manager of bam project
my repository : /var/lib/svn/repositories/bam

my virutual host:


<VirtualHost x.x.x.x:80>
  ServerName myhost.com
#  ServerAlias svn

  ServerAdmin webmaster@localhost

 # DocumentRoot /var/lib/svn/repositories

#   PerlRequire /usr/lib/perl5/Apache2/Redmine.pm
    PerlLoadModule Apache2::Redmine

<Location /repos>
  DAV svn
  SVNPath "/var/lib/svn/repositories" 
  Order deny,allow
  Deny from all
#  Satisfy any

     PerlAccessHandler Apache::Authn::Redmine::access_handler
     PerlAuthenHandler Apache::Authn::Redmine::authen_handler

  AuthType Basic
  AuthName "Subversion Repository" 
  AuthUserFile /etc/apache2/dav_svn.passwd

# read access
    <Limit GET PROPFIND OPTIONS REPORT>
       Require valid-user
       Allow from myip

       # Allow from another-ip
#        Satisfy any
    </Limit>
# write access
    <LimitExcept GET PROPFIND OPTIONS REPORT>
      Require valid-user
    </LimitExcept>

## for postgres
     RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost" 
     RedmineDbUser "redmine" 
     RedmineDbPass "password" 

</Location>

ErrorLog /var/log/apache2/svn_error.log
  LogLevel warn
  CustomLog /var/log/apache2/svn_access.log combined

</VirtualHost>

I recive :
the testuser'll not sent ..

  - - [02/Aug/2010:22:25:00 +0200] "OPTIONS /repos/bam HTTP/1.1" 500 423 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 

In redmine windows "Eintrag und/oder Revision existiert nicht im Projektarchiv."

In /var/log/redmine/default/production.log
....

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:228:in `build'
/usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize'
...

...
No close tag for /lists/list
Line:
Position:
Last 80 unconsumed characters:
Output was:
 <?xml version="1.0"?>
<lists>
<list
   path="http://myhost.com/repos/bam">
Rendering template within layouts/base
Completed in 199ms (View: 17, DB: 10) | 500 Internal Server Error [http://myhost.com/projects/bam/repository]


In Apache errorlog:

[Mon Aug 02 22:25:00 2010] [error] [client xxx.xxx.xxx.xxx] Could not fetch resource information.  [500, #0]
[Mon Aug 02 22:25:00 2010] [error] [client xxx.xxx.xxx.xxx] Could not open the requested SVN filesystem  [500, #2]
[Mon Aug 02 22:25:00 2010] [error] [client xxx.xxx.xxx.xxx] Could not open the requested SVN filesystem  [500, #2]

With http and pw I didn't have problem. 

Thanks,
Gio

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

I just noticed 2 things: what do you need the AuthUserFile /etc/apache2/dav_svn.passwd for? But more importantly: shouldn't it be SVNParentPath rather than SVNPath?

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Hello Felix,
1000 Thanks,
I wanted to use both Auth (one in web_dav with pw file and one in Redmine with pg auth).
Ist it no possible?

I change the 2 Things an I cannot recive the old error :).
But I recive a new one. This take a long time (> 2 minuts)

 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/bln/1871 HTTP/1.1" 207 466 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 452 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/bln/1871 HTTP/1.1" 207 466 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 472 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/bc/1871 HTTP/1.1" 207 768 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "REPORT /repos/bam HTTP/1.1" 200 335 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 472 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/bc/1871 HTTP/1.1" 207 449 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:58 +0200] "PROPFIND /repos/bam/!svn/bc/1871 HTTP/1.1" 207 678 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "OPTIONS /repos/bam HTTP/1.1" 200 873 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 452 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/bln/1871 HTTP/1.1" 207 466 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 452 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/bln/1871 HTTP/1.1" 207 466 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 452 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/bln/1871 HTTP/1.1" 207 466 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam HTTP/1.1" 207 546 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 472 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 
 - - [03/Aug/2010:08:36:59 +0200] "REPORT /repos/bam/!svn/bc/1871 HTTP/1.1" 200 562 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 

Thanks for your patience.
Gio

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

Mmh, I don't think you will be able to use Redmine auth and "AuthFile" auth on the same Location, because if you have a user in your AuthFile, it will get authenticated (apache will know who the user is) but you won't have that user in redmine, and Redmine.pm won't be able to authorize him (i.e. apache won't know what that user has the permission to do). You could do 2 different Locations/VHosts for that though.

Regarding the timings/performance, I can't say much without having a closer look or knowing more about your system, sorry.

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Hello Felix,
thank you very much.
I do it with two location an all works fine.

The only "nemulosity" is this 207 error in Apache.

[03/Aug/2010:08:36:59 +0200] "PROPFIND /repos/bam/!svn/vcc/default HTTP/1.1" 207 472 "-" "SVN/1.6.12 (r955767) neon/0.29.3" 

Can you give me a Idea?

Thanks.
Have a nice day.
Gio

RE: Subversion Auth does't work - Added by Felix Schäfer about 12 years ago

I don't know what 207 is, what's the error message?

RE: Subversion Auth does't work - Added by Arnaud Martel about 12 years ago

207 is not an error code. That's the success return code for a PROPFIND request (used with WEBDAV protocol)....

RE: Subversion Auth does't work - Added by Giovanna Ratini about 12 years ago

Hello Arnaud, hello Felix :).
Super :). Thank you very much for help.
Gio

(1-15/15)