Comment 1 for bug 294560

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: [Bug 294560] [NEW] Error with WebDAV requiring http authentication

>>>>> "david" == dmuir writes:

    david> Public bug reported:

Thanks a lot ! I'll to clarify a couple of points below.

    david> Related to: #72792

No, it's a different kind of problem.

    david> bzr 1.8
    david> webdav 1.6.0
    david> python 2.5
    david> pycurl 7.16.4

bzr-webdav doesn't make use of pycurl if you see pycurl involved,
we have a bug :)

    david> bzr init-repo http+webdav://<urlToRepo>
    david> gives me:
    david> bzr: ERROR: Invalid http response for http://<urlToRepo>: Unable to handle http code 401: Authorization Required

Basically either the credentials were not provided or they were
wrong (this doesn't imply a user error but it may be the case).

    david> bzr init-repo http+webdav://<user>:<pass>@<urlToRepo>
    david> gives me:
    david> bzr: ERROR: http://<urlToRepo> is permanently redirected to http://<urlToRepo/

As mentioned in the NOTES file in plugin directory:

 # DirectorySlash tells apache to reply with redirections if
 # directories miss their final '/'. It does not play well with
 # bzr (to they the least) and provide no benefits in our
 # case. So just turn it off.
 DirectorySlash Off

I think this is the root cause. Can you try that option on your
server ?

    david> I've tried supplying the authentication details in authentication.conf,
    david> but as far as I can tell, this file is being ignored.

Can you join your authentication.conf to this bug so we can debug
it may be ?

You may also want to use -Dauth to see what section is taken into
account (or not).

<snip/>

    david> Here's the debug log for:
    david> bzr init-repo http+webdav://<user>:<pass>@bzr.tekika.com/edval

    david> 0.016 encoding stdout as sys.stdout encoding 'UTF-8'
    david> 0.017 bzr arguments: [u'init-repo', u'-Dhttp', u'http+webdav://<user>:<pass>@bzr.tekika.com/edval']
    david> 0.017 looking for plugins in /home/dmuir/.bazaar/plugins
    david> 0.021 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
    david> 0.021 Plugin name __init__ already loaded
    david> 0.021 Plugin name __init__ already loaded
    david> 0.070 encoding stdout as sys.stdout encoding 'UTF-8'
    david> 0.095 * About to connect() to bzr.tekika.com:80
    david> 0.506 > MKCOL /edval
    david> 0.506 > Host: bzr.tekika.com
    >> Accept: */*
    >> User-Agent: bzr/1.8 (urllib)
    >> Connection: Keep-Alive
    >> Pragma: no-cache
    >> Cache-Control: max-age=0

    david> 0.757 < HTTP/1.1 401 Authorization Required
    david> 0.758 < Date: Thu, 06 Nov 2008 06:29:35 GMT
    david> < Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 Phusion_Passenger/2.0.3 DAV/2
    david> < WWW-Authenticate: Basic realm="Edval Area"
    david> < Vary: Accept-Encoding
    david> < Content-Length: 520
    david> < Keep-Alive: timeout=2, max=100
    david> < Connection: Keep-Alive
    david> < Content-Type: text/html; charset=iso-8859-1

    david> 0.759 > MKCOL /edval
    david> 0.760 > Host: bzr.tekika.com
    >> Accept: */*
    >> User-Agent: bzr/1.8 (urllib)
    >> Connection: Keep-Alive
    >> Pragma: no-cache
    >> Cache-Control: max-age=0

    >> Authorization: Basic

<cough> You'd better change that password ASAP, basic is.. well, basic.

Sorry about that, I should have told you to censor that part of the log :-/

      Vincent