0

I have just configured svn over https (with apache2). I can svn checkout fine, however commits are failing. I can see from the apache2 logs that the svn server is looking in the wrong place to find the repository for doing the commit. Here is my apache2 443.example.com.conf file:

<IfModule mod_ssl.c>
    <virtualhost *:443>
    # requests to https://example.com land here
    ServerName example.com
    DocumentRoot /home/me/svn-repos

    # global properties for all directories in this site
    <Location />
        # do not use .htaccess files
        allowoverride none
        #DirectoryIndex index.html
        #require all granted                                                                                    

        DAV svn
        SVNParentPath /home/me/svn-repos
        AuthType Basic
        AuthName "svn repositories"
        AuthUserFile blah.passwd
        #<LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
        #</LimitExcept>
    </Location>

    SSLEngine On
    SSLCertificateFile blah
    SSLCertificateKeyFile blah

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>

    ErrorDocument 400 /index.html
    ErrorDocument 401 /index.html
    # lots more ErrorDocument entries

    </virtualhost>
</IfModule>

Note that all my svn repositories are in directories under /home/me/svn-repos (eg. /home/me/svn-repos/repo1, /home/me/svn-repos/repo2, etc)

So I check out a fresh local copy of one of my repositories:

$ cd /tmp
$ svn co --username me https://example.com/repo1 repo1
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

A repo1/file1.txt
Checked out revision 1.

So far so good. But then when I try and commit:

$ touch file2.txt
$ svn add file2.txt
A     file2.txt
$ svn ci file2.txt -m added
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

Adding         file2.txt
svn: E175009: Commit failed (details follow):
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found

And I can see from the apache2 error log that svn server is looking in the wrong place for the repository:

$ sudo tail -4 /var/log/apache2/error.log
[Sat Dec 02 20:23:29.626227 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client x.x.x.x:x] Can't open file '/home/me/svn-repos/index.html/format': Not a directory
[Sat Dec 02 20:23:29.626264 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:23:29.626272 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]
[Sat Dec 02 20:23:29.626277 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]

The file it is looking for is /home/me/svn-repos/repo1/format, however it is not appending the correct path to be able to find the file. I suspect this means that I need to put something in my apache2 443.example.com.conf file, but I can't think what.

Update

I made the following change to the 443.example.com.conf file:

# ErrorDocument 404 /index.html
ErrorDocument 404 /indexyz.html

And now when I try doing the commit then the error message changed to this:

[Sat Dec 02 20:39:00.153942 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client 192.168.1.177:50228] Can't open file '/home/me/svn-repos/indexyz.html/format': No such file or directory
[Sat Dec 02 20:39:00.153979 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:39:00.153987 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]
[Sat Dec 02 20:39:00.153992 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]

But that still doesn't help much.

1
  1. You made all possible errors (3/3)
  2. You didn't read SVN Book

Fix:

  • Repos must not be inside http-tree
  • SVN location must not be in root of http-host
  • SVN location must not be in physical path inside http-host, only in logical
3
  • thanks for the reply. i followed these instructions on the svn website but i didn't see the errors you listed. – mulllhausen Dec 4 '17 at 13:07
  • @mulllhausen RLLY didn't see? Okay, U wanna 2 re-read bukz carefully again – Lazy Badger Dec 5 '17 at 13:33
  • this answer was very misleading and turned out to be false. – mulllhausen Dec 6 '17 at 11:15
0

I finally got it working. In the end it was nothing to do with the document root, it was the ErrorDocument declarations - I just needed to change them from /index.html to default. My final configuration looks like this:

<IfModule mod_ssl.c>
    <virtualhost *:443>
        # requests to https://example.com land here
        ServerName example.com
        DocumentRoot /home/me/svn-repos

        # global properties for all directories in this site
        <Location />
            # do not use .htaccess files
            allowoverride none

            DAV svn
            SVNParentPath /home/me/svn-repos
            AuthType Basic
            AuthName "svn repositories"
            AuthUserFile blah.passwd
            Require valid-user
        </Location>

        # http://svnbook.red-bean.com/en/1.7/svn.serverconfig.httpd.html
        CustomLog ${APACHE_LOG_DIR}/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
        ErrorLog ${APACHE_LOG_DIR}/error.log

        SSLEngine On
        SSLCertificateFile fullchain.pem
        SSLCertificateKeyFile privkey.pem

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>

        ErrorDocument 400 default
        ErrorDocument 401 default
        ErrorDocument 402 default
        ErrorDocument 403 default
        ErrorDocument 404 default
        ErrorDocument 405 default
        ErrorDocument 406 default
        ErrorDocument 407 default
        ErrorDocument 408 default
        ErrorDocument 409 default
        ErrorDocument 410 default
        ErrorDocument 411 default
        ErrorDocument 412 default
        ErrorDocument 413 default
        ErrorDocument 414 default
        ErrorDocument 415 default
        ErrorDocument 416 default
        ErrorDocument 417 default
        #ErrorDocument 418 default
        ErrorDocument 421 default
        ErrorDocument 422 default
        ErrorDocument 423 default
        ErrorDocument 424 default
        ErrorDocument 426 default
        ErrorDocument 428 default
        ErrorDocument 429 default
        ErrorDocument 431 default
        ErrorDocument 451 default
        ErrorDocument 500 default
        ErrorDocument 501 default
        ErrorDocument 502 default
        ErrorDocument 503 default
        ErrorDocument 504 default
        ErrorDocument 505 default
        ErrorDocument 506 default
        ErrorDocument 507 default
        ErrorDocument 508 default
        ErrorDocument 510 default
        ErrorDocument 511 default
    </virtualhost>
</IfModule> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.