Incorrect read length, http and php

David Allouche david at allouche.net
Thu Sep 21 17:07:07 BST 2006


There has been some recent discussion in this mailing on how to handle
short reads in remote transports. I have an interesting story that touch
the subject and might be relevant.

This last week there were a problem in the vcs-imports service of
Launchpad. Some import branch could not be mirrored and failed with a
rather mysterious error which appeared related to a short read problem.

Long story short, one of the internal http servers in the system had php
enabled and for some reason tried to interpret a knit file for a php
source file as a php script. Of course, that failed, and the GET
returned an error message as a HTML document intead of the knits contents.

The really weird thing is that this problem occurred only when trying to
access the branch with urllib; apparently pycurl somehow managed to
disable server side parsing. This was tested with bzr 0.8, 0.9 and 0.10.

This problem has probably not been reported before because I do not
think there are many php-based projects using bzr. But it's still here
lurking to bite unsuspecting dumb-server clients.

This story tells me a few interesting things:

 * Perfectly competent sysadmins can have misconfigured webservers that
will not give the actual contents of the file, but random crap instead.
Bzr should ideally be able to give intelligible error messages in such
cases.

 * It would be good if checksums were stored in knit indexes and used to
detect data corruption during transport.

 * Short reads may be a symptom of transport level data corruption.

 * It looks like pycurl does some weird magic to disable server-side
parsing. It would be good to know more about it and emulate it with urllib.

-- 
                                                            -- ddaa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060921/e7649946/attachment.pgp 


More information about the bazaar mailing list