I have a Ubuntu 20.04 PC that I am setting up as a Subversion server with Apache 2.4 web server to allow me to use the Ankh client plug-in with Visual Studio on a Windows 10 PC.
How do I fix the Unknown DAV provider: svn
error reported by the Apache2 web server when I do a restart? I think it may be connected to an error I see, dpkg: error processing package libapache2-mod-svn
, when doing a sudo apt reinstall subversion
.
I originally had both Apache and Subversion installed and after making configuration file changes, it was working fine.
I then uninstalled and cleaned up both in order to redo the installation, documenting my procedure. I'm a bit hazy on the details however the basics were to:
- use
sudo apt remove apache2
andsudo apt remove subversion
- remove some remaining directories such as
/etc/apache2
The reinstall has not gone well. For some reason installation seems to have been partial as if the apt install
command was finding components and assuming other components also already existed when they did not. In some cases using apt reinstall
has fixed issues and in other cases I built configuration files by hand.
I am now at the point where Apache web server is working and serving pages. Subversion is also working from the command line in Ubuntu.
I am now having a problem with the DAV component of Apache for the Subversion interface not working.
I am seeing an error when I attempt to enable the several dav
related modules.
rick@rick-MS-7B98:/etc/apache2$ sudo a2enmod dav dav_fs dav_svn
Enabling module dav.
Considering dependency dav for dav_fs:
Module dav already enabled
Enabling module dav_fs.
Considering dependency dav for dav_svn:
Module dav already enabled
Enabling module dav_svn.
To activate the new configuration, you need to run:
systemctl restart apache2
rick@rick-MS-7B98:/etc/apache2$ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
rick@rick-MS-7B98:/etc/apache2$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2020-12-13 15:21:50 EST; 13s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 74845 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Dec 13 15:21:50 rick-MS-7B98 systemd[1]: Starting The Apache HTTP Server...
Dec 13 15:21:50 rick-MS-7B98 apachectl[74858]: [Sun Dec 13 15:21:50.461280 2020] [so:warn] [pid 74858] AH01574: module dav_fs_module is already loaded, skipping
Dec 13 15:21:50 rick-MS-7B98 apachectl[74858]: AH00526: Syntax error on line 16 of /etc/apache2/mods-enabled/dav_svn.conf:
Dec 13 15:21:50 rick-MS-7B98 apachectl[74858]: Unknown DAV provider: svn
Dec 13 15:21:50 rick-MS-7B98 apachectl[74845]: Action 'start' failed.
Dec 13 15:21:50 rick-MS-7B98 apachectl[74845]: The Apache error log may have more information.
Dec 13 15:21:50 rick-MS-7B98 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 13 15:21:50 rick-MS-7B98 systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 13 15:21:50 rick-MS-7B98 systemd[1]: Failed to start The Apache HTTP Server.
When I attempt to do a reinstall
of Subversion, I see a dpkg: error processing package labapache2-mod-svn
rick@rick-MS-7B98:~$ sudo ap reinstall subversion
sudo: ap: command not found
rick@rick-MS-7B98:~$ sudo apt reinstall subversion
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/824 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 196796 files and directories currently installed.)
Preparing to unpack .../subversion_1.13.0-3_amd64.deb ...
Unpacking subversion (1.13.0-3) over (1.13.0-3) ...
Setting up libapache2-mod-svn (1.13.0-3) ...
dpkg: error processing package libapache2-mod-svn (--configure):
installed libapache2-mod-svn package post-installation script subprocess returned error exit status 1
Setting up subversion (1.13.0-3) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
libapache2-mod-svn
E: Sub-process /usr/bin/dpkg returned an error code (1)
And when I check the status of Subversion:
rick@rick-MS-7B98:~$ svn --version
svn, version 1.13.0 (r1867053)
compiled Mar 24 2020, 12:33:36 on x86_64-pc-linux-gnu
Copyright (C) 2019 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- using serf 1.3.9 (compiled with 1.3.9)
- handles 'http' scheme
- handles 'https' scheme
The following authentication credential caches are available:
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)
When I check to find out what uses libapache2-mod-svn
, I get the following.
rick@rick-MS-7B98:~$ dpkg -S libapache2-mod-svn
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/examples/svnindex.css
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/INSTALL.authz.gz
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/README.Debian
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/changelog.Debian.gz
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/examples/svnindex.xsl
libapache2-mod-svn: /usr/share/lintian/overrides/libapache2-mod-svn
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/copyright
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/examples
libapache2-mod-svn: /usr/share/doc/libapache2-mod-svn/NEWS.Debian.gz
As part of investigating setting up a Subversion repository with access via the Apache web server, I wanted to remove both Subversion and Apache2 then do the installation all over again.
When doing the installation a second time, it appears that the install resulted in some missing files and components, in particular
/etc/apache2/
files and directories such asmods-enabled
. The severaldav
files (dav_fs.conf
,dav_fs.load
,dav.load
,dav_svn.conf
, anddav_svn.load
) were also missing. However after redoing theapt
command with thereinstall
option, the files were recreated. inmods-available
but the symbolic links inmods-enabled
were not created for thedav
files.I was able to correct Apache2 server start up errors by looking at the status with the command
systemctl status apache2.service
and by looking at the Apache2 server logs in/var/log/apache2
and searching the internet for the error messages.With this error, several articles mentioned adding the directive
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
to the filehttpd2.conf
however in my Apache server there is a file/etc/apache2/apache2.conf
which appears to be the starting point for configuration parameters and during processing of this file, other files located in sub-directories per these comments from/etc/apache2/apache2.conf
:The additional configuration files are loaded with
IncludeOptional
directives inapache2.conf
.Based on the suggestion of @user535733, who pointed to Unix & Linux StackExchange: Unknown DAV provider: svn, I decided to try the
LoadModule
directive by recreating the file/etc/apache2/mods-available/dav_svn.load
with the following:then doing the symbolic link into the directory
/etc/apache2/mods-enabled/
.This worked once I also created the symbolic links for the other DAV related files (
dav_fs.conf
,dav_fs.load
, anddav.load
).sudo apt upgrade errors
I thought that I had everything fixed however a few days later I tried to run
sudo apt upgrade
after runningsudo apt update
and the following errors were displayed:I tried a couple of things to clear this error before finally able to do so.
I tried
sudo apt reinstall libapache2-mod-svn
which gave me a similar error.I tried
sudo apt remove libapache2-mod-svn
which worked and I was able to do thesudo apt upgrade
without an error however the module was now removed.I tried
sudo apt-get install libapache2-mod-svn
which gave me a similar error.I then tried several commands suggested in an article about this type of error:
sudo dpkg --configure -a
andsudo apt-get install -f
with the following errors:I tried to correct these errors by using the
sudo apt remove libapache2-mod-svn
then doingsudo apt update
thensudo apt upgrade
and thensudo apt install libapache2-mod-svn
and it failed with similar error messages.Finally I used a series of commands to remove (
sudo apt remove libapache2-mod-svn
), purge (sudo apt purge libapache2-mod-svn
), and then install (sudo apt-get install libapache2-mod-svn
) and that seemed to work fine with no errors. I then had to modify the/etc/apache2/mods-enabled/dav_svn.conf
file again and I was able to access my Subversion repository throughhttp://192.168.0.4/svn
.