Access control

Jeffrey Cunningham jcunningham at medea.sea.boeing.com
Wed Feb 28 18:00:30 GMT 2007


Vincent Ladeuil wrote:
<snip/>

> But anyway, we must solve that 400 problem first.
> 
>     >> Also, are you able to browse ~jcunningham/docs/.bzr/branch-format
>     >> itself ? What is its content ?
> 
>     Jeff> Yes. Here's what comes up in Mozilla:
>     Jeff> Bazaar-NG meta directory, format 1
> 
> Correct. That means Apache accepts to serve '.bzr', that leaves
> us with a '~' translation.
> 
>     >> Not yet, but if you could provide your $HOME/.bzr.log, anonymized
>     >> as you see fit but I think it's ok as is.
>     >> 
> 
>     Jeff> return code 3
>     Jeff> bzr arguments: [u'branch',
>     Jeff> u'http+pycurl://jeff:password@medea.sea.boeing.com/~jcunningham/docs']
>     Jeff> looking for plugins in /home/jcunningham/lib/python/bzrlib/plugins
>     Jeff> Plugin name __init__ already loaded
>     Jeff> Plugin name __init__ already loaded
>     Jeff> looking for plugins in /home/jcunningham/.bazaar/plugins
>     Jeff> encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
>     Jeff> using pycurl libcurl/7.15.1 GnuTLS/1.4.4 zlib/1.2.3 libidn/0.5.15
> 
> <snip/>
> 
>     Jeff> "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py",
>     Jeff> line 124, in _get
>     Jeff>     return self._get_full(relpath)
>     Jeff>   File
>     Jeff> "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py",
>     Jeff> line 167, in _get_full
>     Jeff>     self._raise_curl_http_error(
>     Jeff>   File
>     Jeff> "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py",
>     Jeff> line 223, in _raise_curl_http_error
>     Jeff>     raise errors.InvalidHttpResponse(
>     Jeff> InvalidHttpResponse: Invalid http response for
>     Jeff> http://jeff:password@medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format:
>     Jeff> Unable to handle http code 400: expected 200 or 404 for full
>     Jeff> response.
> 
> Apache send us a 400 error code. The question is why.
> 
>     Jeff> return code 3
>     Jeff> bzr arguments: [u'branch',
>     Jeff> u'http+urllib://jeff:password@medea.sea.boeing.com/~jcunningham/docs']
>     Jeff> looking for plugins in /home/jcunningham/lib/python/bzrlib/plugins
>     Jeff> Plugin name __init__ already loaded
>     Jeff> Plugin name __init__ already loaded
>     Jeff> looking for plugins in /home/jcunningham/.bazaar/plugins
>     Jeff> encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
>     Jeff> GET: [http://medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format]
> 
> Unambiguous.
> 
> <snip/>
> 
>     Jeff> "/home/jcunningham/lib/python/bzrlib/transport/http/_urllib2_wrappers.py",
>     Jeff> line 777, in http_error_default
>     Jeff>     'Unable to handle http code %d: %s'
>     Jeff> InvalidHttpResponse: Invalid http response for
>     Jeff> http://medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format:
>     Jeff> Unable to handle http code 401: Authorization Required
> 
> Strange, if you use the basic auth, that should work not raise a 401.
> 
>     Jeff> return code 3
>     Jeff> bzr arguments: [u'branch',
>     Jeff> u'http://jeff:password@medea.sea.boeing.com/~jcunningham/docs']
>     Jeff> looking for plugins in /home/jcunningham/lib/python/bzrlib/plugins
>     Jeff> Plugin name __init__ already loaded
>     Jeff> Plugin name __init__ already loaded
>     Jeff> looking for plugins in /home/jcunningham/.bazaar/plugins
>     Jeff> encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
>     Jeff> using pycurl libcurl/7.15.1 GnuTLS/1.4.4 zlib/1.2.3 libidn/0.5.15
> 
> Now that you have installed pycurl, it is selected as the default
> implementation.
> 
> <snip/>
> 
>     Jeff> Thanks, Vincent.
> 
> Except for the 400 error code, nothing suspicious here.
> 
> Next step is to check the Apache logs to verify that we try to
> get the same file than Mozilla.
> 
> You can also try to activate some debug:
> 
> - for urllib, in the file
>   /home/jcunningham/lib/python/bzrlib/transport/http/_urllib2_wrappers.py
>   edit the line 'DEBUG = 0' to 'DEBUG = 1'
> 
> - for pycurl, in the file
>   /home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py
>   search for a commented line '## curl.setopt(pycurl.VERBOSE, 1)'
>   and delete the leading '## ', be careful to align that line
>   with the others, python is strict about the lines alignment.
> 
> The output will be a bit verbose but will show all headers
> exchanged between bzr and Apache, that may reveal something.
> 
>           Vincent


I looked in both /var/logs/apache2/error_log and access_log and the only 
thing that shows up is the "File does not exist: 
/var/www/localhost/htdocs/favicon.ico" error from the Mozilla reads. 
Nothing is being logged for the bzr activity. (?!). And I checked the 
httpd.conf to make sure that logging is set to DEBUG.

I also made the changes you suggested to the two .py files and 
recompiled everything. Here is the resulting error in the terminal 
window, and following that the corresponding .bzr.log entry.


* About to connect() to proxy www-blv-proxy.boeing.com port 31060
*   Trying 192.48.21.150... * connected
* Connected to www-blv-proxy.boeing.com (192.48.21.150) port 31060
* Server auth using Basic with user 'jcunningham'
 > GET 
http://jeff:password@medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format 
HTTP/1.1
Authorization: Basic amN1bm5pbmdoYW06amtjMTIz
User-Agent: bzr/0.14.0 (pycurl)
Host: medea.sea.boeing.com
Accept: */*
Proxy-Connection: Keep-Alive
Cache-control: max-age=0
Pragma: no-cache
Connection: Keep-Alive

< HTTP/1.1 400 Bad Request
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html
* HTTP/1.1 proxy connection set close!
< Proxy-Connection: close
< Connection: close
< Content-Length: 6822
* Closing connection #0
bzr: ERROR: Invalid http response for 
http://jeff:password@medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format: 
Unable to handle http code 400: expected 200 or 404 for full response.
j




return code 3
bzr arguments: [u'branch', 
u'http://jeff:password@medea.sea.boeing.com/~jcunningham/docs']
looking for plugins in /home/jcunningham/lib/python/bzrlib/plugins
Plugin name __init__ already loaded
Plugin name __init__ already loaded
looking for plugins in /home/jcunningham/.bazaar/plugins
encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
using pycurl libcurl/7.15.1 GnuTLS/1.4.4 zlib/1.2.3 libidn/0.5.15
Traceback (most recent call last):
   File "/home/jcunningham/lib/python/bzrlib/commands.py", line 650, in 
run_bzr_catch_errors
     return run_bzr(argv)
   File "/home/jcunningham/lib/python/bzrlib/commands.py", line 612, in 
run_bzr
     ret = run(*run_argv)
   File "/home/jcunningham/lib/python/bzrlib/commands.py", line 304, in 
run_argv_aliases
     return self.run(**all_cmd_args)
   File "/home/jcunningham/lib/python/bzrlib/builtins.py", line 712, in run
     br_from = Branch.open(from_location)
   File "/home/jcunningham/lib/python/bzrlib/branch.py", line 119, in open
     control = bzrdir.BzrDir.open(base, _unsupported)
   File "/home/jcunningham/lib/python/bzrlib/bzrdir.py", line 500, in open
     return BzrDir.open_from_transport(t, _unsupported=_unsupported)
   File "/home/jcunningham/lib/python/bzrlib/bzrdir.py", line 509, in 
open_from_transport
     format = BzrDirFormat.find_format(transport)
   File "/home/jcunningham/lib/python/bzrlib/bzrdir.py", line 1059, in 
find_format
     return format.probe_transport(transport)
   File "/home/jcunningham/lib/python/bzrlib/bzrdir.py", line 1069, in 
probe_transport
     format_string = transport.get(".bzr/branch-format").read()
   File 
"/home/jcunningham/lib/python/bzrlib/transport/http/__init__.py", line 
226, in get
     code, response_file = self._get(relpath, None)
   File "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py", 
line 124, in _get
     return self._get_full(relpath)
   File "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py", 
line 167, in _get_full
     self._raise_curl_http_error(
   File "/home/jcunningham/lib/python/bzrlib/transport/http/_pycurl.py", 
line 223, in _raise_curl_http_error
     raise errors.InvalidHttpResponse(
InvalidHttpResponse: Invalid http response for 
http://jeff:password@medea.sea.boeing.com/~jcunningham/docs/.bzr/branch-format: 
Unable to handle http code 400: expected 200 or 404 for full response.

return code 3


Regards,
--Jeff



More information about the bazaar mailing list