elleFlorio / svn-docker

Lightweight Docker image to build a container running an SVN server
MIT License
145 stars 106 forks source link

Error: Call to a member function getSections() on null #24

Closed wmht closed 3 years ago

wmht commented 4 years ago

Error in viewing user or group details,LDAP is already configured. image image

Error: Call to a member function getSections() on null

0 /opt/svnadmin/include/ifcorelib/IF_SVNAuthFileC.class.php(723): IF_SVNAuthFileC->repositories()

1 /opt/svnadmin/classes/providers/AuthFileGroupAndPathsProvider.class.php(294): IF_SVNAuthFileC->permissionsOfUser('august')

2 /opt/svnadmin/userview.php(114): svnadmin\providers\AuthFileGroupAndPathProvider->getPathsOfUser(Object(svnadmin\core\entities\User))

3 {main}

elleFlorio commented 3 years ago

Hello,

Sorry but I don't have enough information to understand this issue. Looks more like an issue of the web interface itself.

petros-d commented 3 years ago

In case anyone else comes across this, I was hitting this exact same error and found a resolution.

The issue existed after setting the LDAP connection information, LDAP user provider information and the LDAP group provider information. The fix was to configure the other settings available, with the correct values for this Docker image shown below:

Subversion authorization file: /etc/subversion/passwd Parent directory of repositories: /home/svn Subversion client executable: /usr/bin/svn Subversion admin executable: /usr/bin/svnadmin

That solved the error raised here, but I then hit other issues with getting Apache to authenticate users with LDAP, for that I had to install an additional package apk add apache2-ldap, as well as edit the /etc/apache2/conf.d/dav_svn.conf file, to add the following:

AuthBasicProvider ldap
AuthLDAPURL "ldap://ldap.example.com/OU=SVN,DC=example,DC=com?sAMAccountName"
AuthLDAPBindDN "CN=svn-bind,OU=SVN,DC=example,DC=com"
AuthLDAPBindPassword "password"

This got LDAP auth on the Apache side for the /svn endpoint just about working, with some caveats:

  1. LDAP binds are not over SSL (see https://github.com/mfreiholz/iF.SVNAdmin/issues/158 for another issue)
  2. Permissions for the SVN repos didn't seem consistent with access paths (users got errors when trying to push)
  3. Old Alpine image, potential security issues

It's at this point, I figured this wasn't ideal for a production SVN server with LDAP support, and went searching for alternatives. For those curious, SVN Edge looked to be a good option, and was easy enough to setup: Docker image: https://hub.docker.com/r/svnedge/app Install docs: https://ctf.open.collab.net/sf/wiki/do/viewPage/projects.svnedge/wiki/Docker Docs on auth: http://help.collab.net/index.jsp?topic=/csvn/action/configurecsvn_authentication.html

@elleFlorio thanks for this project and the related blog post, was a great intro to running SVN in Docker!