bzr branch and checkout over HTTP fail with "ERROR: No such file"

Bug #57309 reported by Lauri Kainulainen
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
John A Meinel

Bug Description

Running on dapper here with bzr 0.8.2 from official repos.

Reproduce:
1. create a new directory
2. add text files (PHP files here)
3. bzr init, bzr add *, bzr commit
4. rsync via ssh ( rsync -avrze ssh myBzrDir <email address hidden>:html/bzr )
5. bzr branch http://www.server.com:html/bzr/myBzrDir (or use bzr checkout)

Fails with:
bzr: ERROR: No such file: 'http://www.server.com:html/bzr/myBzrDir/.bzr/repository/knits/bc/%254b%2549%2553%2553auth.php-20060822155416-c2bd64d639754517.kndx'

The kndx file is not present on the local branch either. Branching and checking out work on from the local branch but not over HTTP.

description: updated
Revision history for this message
John A Meinel (jameinel) wrote :

You cannot checkout over a readonly transport. So that will always fail.

I'm trying to figure out what:

http://www.server.com:html/ is
:html doesn't look valid as part of a URL, since it isn't a port number, etc. It may be we are puking on that.

Are you running a proxy on the html server? It is possible that you are running into bugs with how we encode urls. At one point we found that Apache 1.3 strips the url encoding when running as a proxy.

it takes a url like foo_%254b and translates it into %4b and passes it down the line, which then gets unescaped again into 'K' which doesn't exist.

The above line is the escaped form of the path. The path you want to look for is:
/bzr/myBzrDir/.bzr/repository/knits/bc/%4b%49%53%53auth.php-20060822155416-c2bd64d639754517.kndx

If that doesn't exist in the remote path, then you probably have a rsync related problem.

If it *does* exist, then you have an Apache configuration problem.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 57309] bzr branch and checkout over HTTP fail with "ERROR: No such file"

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lauri Kainulainen wrote:
> Public bug reported:
>
> Running on dapper here with bzr 0.8.2 from official repos.
>
> Reproduce:
> 1. create a new directory
> 2. add text files (PHP files here)
> 3. bzr init, bzr add *, bzr commit
> 4. rsync via ssh ( rsync -avrze ssh myBzrDir <email address hidden>:html/bzr )
> 5. bzr branch http://www.server.com:html/bzr/myBzrDir (or use bzr checkout)
>
> Fails with:
> bzr: ERROR: No such file: 'http://www.server.com:html/bzr/myBzrDir/.bzr/repository/knits/bc/%254b%2549%2553%2553auth.php-20060822155416-c2bd64d639754517.kndx'
>
>
> The kndx file is not present on the local branch either.

The local filename would be:
.bzr/repository/knits/bc/%4b%49%53%53auth.php-20060822155416-c2bd64d639754517.kndx

It is quite likely that your web server is configured to treat any
filename containing ".php" as a php file, even when the filename
actually ends with ".kndx"

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFE6zRH0F+nu1YWqI0RAlcNAJ9nIO4HD6QpI7gQ5D/MoZjLeJU/aQCfbDAD
vN8WhYMBeH6NBAm+pYfxDaM=
=dRLm
-----END PGP SIGNATURE-----

Revision history for this message
Lauri Kainulainen (luopio) wrote :

This time the straight output from console, with all the real stuff (except the username for the server).

Starting from an empty new dir:

$ cp ../KISS/*.php .
$ bzr init
$ bzr add *
added KISSauth.php
added KISSblog.php
added KISScomments.php
added KISSgallery.php
added KISSsmilies.php
$ bzr commit -m "witty remarks go here"
added KISSauth.php
added KISSblog.php
added KISScomments.php
added KISSgallery.php
added KISSsmilies.php
Committed revision 1.
$ rsync -avrze ssh . <email address hidden>:html/lauri/KISS/bzr
<email address hidden>'s password:
building file list ... done

[ a lot of filenames ]

sent 42700 bytes received 544 bytes 5765.87 bytes/sec
total size is 79785 speedup is 1.84
$ bzr branch http://lauri.sokkelo.net/KISS/bzr
bzr: ERROR: No such file: 'http://lauri.sokkelo.net/KISS/bzr/.bzr/repository/knits/16/%254b%2549%2553%2553auth.php-20060822192445-52a9f6c29750ea0b.kndx'
$ ls .bzr/repository/knits/16/
%4b%49%53%53auth.php-20060822192445-52a9f6c29750ea0b.kndx
%4b%49%53%53auth.php-20060822192445-52a9f6c29750ea0b.knit

So it would seem that the problem is related to the apache configuration?

Shame I'm not the admin of that server.. I guess I'll have to rename my files or find another server :( .

Revision history for this message
John A Meinel (jameinel) wrote :

If you upgrade to bzr-0.9 we avoid escaping as often. (we generate file ids that don't need to be escaped)

So you might find that it works (at least for a while) with the same files.

Especially if you are starting from scratch, this might be a possible solution.

Revision history for this message
Lauri Kainulainen (luopio) wrote :

Upgrading to 0.9 fixed the problem! Everything works like a dream now. Thanks :) !

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 57309] Re: bzr branch and checkout over HTTP fail with "ERROR: No such file"

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lauri Kainulainen wrote:
> $ bzr branch http://lauri.sokkelo.net/KISS/bzr
> bzr: ERROR: No such file: 'http://lauri.sokkelo.net/KISS/bzr/.bzr/repository/knits/16/%254b%2549%2553%2553auth.php-20060822192445-52a9f6c29750ea0b.kndx'
> $ ls .bzr/repository/knits/16/
> %4b%49%53%53auth.php-20060822192445-52a9f6c29750ea0b.kndx
> %4b%49%53%53auth.php-20060822192445-52a9f6c29750ea0b.knit
>
>
> So it would seem that the problem is related to the apache configuration?

Yes. If you look at it with a browser:

The requested URL
/~eksynyt/lauri/KISS/bzr/.bzr/repository/knits/16/KISSauth.php-20060822192445-52a9f6c29750ea0b.kndx
was not found on this server.

You can see it has double-decoded %254b%2549%2553%2553 as KISS, when it
should have single-decoded it to %4b%49%53%53.

> Shame I'm not the admin of that server.. I guess I'll have to rename my
> files or find another server :( .

I'm glad 0.9 was able to fix that.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFE7Fvy0F+nu1YWqI0RAhT5AJ0S5yjGgIFWwLSsrepDO69wXHu4BACfQPyE
/7s6CL9df4eUF3RslRalyDw=
=HWJV
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

This has 2 fixes:

1) The primary problem is a misconfigured web server. It is double unescaping % escapes, causing a lookup for the wrong file. This needs to be fixed by the admin of the webserver.

2) bzr-0.9 tries harder to generate file ids that won't cause problems like this. This only affects newly added files though. So existing projects will not benefit and will need to do (1)

Changed in bzr:
assignee: nobody → jameinel
importance: Untriaged → Low
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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