bzr doesn't recognize 404 errors when the server redirects errors to a dedicated page

Bug #226303 reported by ChriS
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

As indicated in bug #129307, branching from some servers that redirect before reporting a 404 error does not work. However, once the initial branching is done (by other means), merging was working with bzr 1.3.1. With bzr 1.4 (or bzr 1.5dev), that fails saying the URL is not a branch.

To reproduce the bug, create a new directory, untar the attached tarball which will create a .bzr/ directory, and do

  bzr merge http://users.skynet.be/Pierre.Brukier/anum/projet/

This works as it should with bzr 1.3.1 but with the 1.5dev one gets:

$ bzr merge
Merging from remembered location http://users.skynet.be/Pierre.Brukier/anum/projet/
http://users.skynet.be/Pierre.Brukier/anum/projet/ is redirected to http://hostingerrors.isp.belgacom.be/Errors.cgi?url=http://users.skynet.be/Pierre.Brukier/anum/projet/
http://users.skynet.be/Pierre.Brukier/anum/ is redirected to http://hostingerrors.isp.belgacom.be/Errors.cgi?url=http://users.skynet.be/Pierre.Brukier/anum/
http://users.skynet.be/Pierre.Brukier/ is redirected to http://hostingerrors.isp.belgacom.be/Errors.cgi?url=http://users.skynet.be/Pierre.Brukier/
bzr: ERROR: Not a branch: "http://users.skynet.be/Pierre.Brukier/anum/projet/".

Trying to get any non-existing file or to obtain the content of a directory will _redirect_ to a 404 page. This is really annoying as this means collaborating with people using this service provider (which is rather common in Belgium) will be harder that it should.

Presumably following redirections (with a warning on stderr if deemed necessary) and not relying on being able to get the content of directories will fix the problem.

P.S. May be related to #36004

Revision history for this message
ChriS (christophe-troestler) wrote :
Revision history for this message
ChriS (christophe-troestler) wrote :

That attachment is a tar.gz file (compressed with gzip, not bzip).

Revision history for this message
Vincent Ladeuil (vila) wrote :

As explained in https://bugs.edge.launchpad.net/bzr/+bug/129307/comments/2, the server lies.

Instead of returning a 404 *error* code, it redirects the request to another page.

This has deep implications in the code base and seems like a significant amount of work to design a work around.

But if you want to provide a patch, I'll do my best to help you there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.