You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@apache.org> on 2018/02/06 17:35:44 UTC

Bad error message when the URL doesn't point to a repository

Earlier today, Julian noted the following on IRC:

$ svn ls http://svn.apache.org/foo
svn: E170013: Unable to connect to a repository at URL 'http://svn.apache.org/foo'
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found


While the first error (Unable to connect ...) makes sense, the errors
about invalid XML do not. It turns out that these errors are generated
when ra_serf tries to parse the OPTIONS response during server
capability negotiation:

$ curl -i -X OPTIONS http://svn.apache.org/foo
HTTP/1.1 200 OK
Date: Tue, 06 Feb 2018 16:31:51 GMT
Server: Apache/2.4.7 (Ubuntu)
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 0


It turns out that our Expat response handler does not check the response
Content-Length header nor the Content-Type. I was going to add these
checks so that we can generate better error messages, but I'm not too
familiar with ra_serf so I wonder if there's a chance that adding these
checks would break anything.

As far as I can see, mod_dav_svn will always correctly set at least
Content-Type (Content-Length is not relevant for chunked responses).

-- Brane






Re: Bad error message when the URL doesn't point to a repository

Posted by Branko Čibej <br...@apache.org>.
On 09.02.2018 17:45, Julian Foad wrote:
> Daniel Shahaf wrote:
>> Branko Čibej wrote on Tue, 06 Feb 2018 22:10 +0100:
>>> The error message now looks like this:
>>>
>>> $ svn ls http://svn.apache.org/foo
>>> svn: E170013: Unable to connect to a repository at URL
>>> 'http://svn.apache.org/foo'
>>> svn: E175003: The server does not support the HTTP/DAV protocol
>>>
>>> Ideas for better wording wold be most welcome.
>
> That's not accurate: the server may support it but not at that URL.
> How about,
>
> "There is no Subversion repository (or WebDAV service) at that URL."

The code I currently have in my working copy can tell the difference
between HTTP only, DAV only and Subversion servers. I'm just not sure
that it makes any sense to tell users about the difference.


>> Add some hints?  E.g.,
>>
>> "If you are the server admin, make sure you have the 'SVNPath' (or
>> 'SVNParentPath') and 'DAV svn' directives in the <Location> block"
>
> I'm not too keen on the user seeing such a message. Most usage occurs
> against already tested servers, so it's likely they just mistyped a
> URL or copy-pasted an inappropriate URL.

Agreed ... user usually can't do anything about it anyway, and admins
will (presumably) know why the server configuration is wrong.

-- Brane

Re: Bad error message when the URL doesn't point to a repository

Posted by Julian Foad <ju...@apache.org>.
Daniel Shahaf wrote:
> Branko Čibej wrote on Tue, 06 Feb 2018 22:10 +0100:
>> The error message now looks like this:
>>
>> $ svn ls http://svn.apache.org/foo
>> svn: E170013: Unable to connect to a repository at URL
>> 'http://svn.apache.org/foo'
>> svn: E175003: The server does not support the HTTP/DAV protocol
>>
>> Ideas for better wording wold be most welcome.

That's not accurate: the server may support it but not at that URL. How 
about,

"There is no Subversion repository (or WebDAV service) at that URL."

> Add some hints?  E.g.,
> 
> "If you are the server admin, make sure you have the 'SVNPath' (or
> 'SVNParentPath') and 'DAV svn' directives in the <Location> block"

I'm not too keen on the user seeing such a message. Most usage occurs 
against already tested servers, so it's likely they just mistyped a URL 
or copy-pasted an inappropriate URL.

- Julian

Re: Bad error message when the URL doesn't point to a repository

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Branko Čibej wrote on Tue, 06 Feb 2018 22:10 +0100:
> The error message now looks like this:
> 
> $ svn ls http://svn.apache.org/foo
> svn: E170013: Unable to connect to a repository at URL 
> 'http://svn.apache.org/foo'
> svn: E175003: The server does not support the HTTP/DAV protocol
> 
> 
> Ideas for better wording wold be most welcome.

Add some hints?  E.g.,

"If you are the server admin, make sure you have the 'SVNPath' (or
'SVNParentPath') and 'DAV svn' directives in the <Location> block"

Re: Bad error message when the URL doesn't point to a repository

Posted by Branko Čibej <br...@apache.org>.
On 06.02.2018 18:35, Branko Čibej wrote:
> Earlier today, Julian noted the following on IRC:
>
> $ svn ls http://svn.apache.org/foo
> svn: E170013: Unable to connect to a repository at URL 'http://svn.apache.org/foo'
> svn: E175009: The XML response contains invalid XML
> svn: E130003: Malformed XML: no element found
>
>
> While the first error (Unable to connect ...) makes sense, the errors
> about invalid XML do not. It turns out that these errors are generated
> when ra_serf tries to parse the OPTIONS response during server
> capability negotiation:
>
> $ curl -i -X OPTIONS http://svn.apache.org/foo
> HTTP/1.1 200 OK
> Date: Tue, 06 Feb 2018 16:31:51 GMT
> Server: Apache/2.4.7 (Ubuntu)
> Allow: GET,HEAD,POST,OPTIONS
> Content-Length: 0
>
>
> It turns out that our Expat response handler does not check the response
> Content-Length header nor the Content-Type. I was going to add these
> checks so that we can generate better error messages, but I'm not too
> familiar with ra_serf so I wonder if there's a chance that adding these
> checks would break anything.
>
> As far as I can see, mod_dav_svn will always correctly set at least
> Content-Type (Content-Length is not relevant for chunked responses).

Seeing that the OPTIONS response is expected to be empty, I implemented
a simple check that we received any DAV headers in the response. The
error message now looks like this:

$ svn ls http://svn.apache.org/foo
svn: E170013: Unable to connect to a repository at URL 'http://svn.apache.org/foo'
svn: E175003: The server does not support the HTTP/DAV protocol


Ideas for better wording wold be most welcome.

-- Brane