bzr branch fails with foreign filenames

Bug #162368 reported by howari
10
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

playing with bzr -svn gave me an error when encountered file which is named as "PTJ_käyttöohje.pdf"
our subversion server is old, it's version 1.2 something I think, if that is meaningful information.
'svn co' has no problems (ver 1.4.4)

 bzr branch svn+https://versionvk.xxxx.yyy/svn/foo/trunk/ptj-src/
 bzr: ERROR: exceptions.KeyError: 'PTJ_k\xc3\xa4ytt\xc3\xb6ohje.pdf'

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 893, in run
    possible_transports=[to_transport])
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/remote.py", line 77, in sprout
    result_repo = repo.clone(result, revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 906, in clone
    self.copy_content_into(dest_repo, revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 819, in copy_content_into
    return InterRepository.get(self, destination).copy_content(revision_id)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py", line 519, in copy_content
    self.fetch(revision_id, pb, find_ghosts=False)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py", line 640, in fetch
    self._fetch_switch(needed, pb, lhs_parent)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py", line 597, in _fetch_switch
    reporter.finish_report(pool)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/errors.py", line 97, in convert
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/transport.py", line 258, in finish_report
    self._baton, pool)
  File "/var/lib/python-support/python2.4/libsvn/ra.py", line 740, in svn_ra_reporter2_invoke_finish_report
    return apply(_ra.svn_ra_reporter2_invoke_finish_report, args)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py", line 296, in open_file
    base_file_id = self._get_old_id(parent_id, path)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py", line 136, in _get_old_id
    return self.old_inventory[parent_id].children[urlutils.basename(old_path)].file_id
KeyError: 'PTJ_k\xc3\xa4ytt\xc3\xb6ohje.pdf'

bzr 0.92.0.candidate.1 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'branch', 'svn+https://versionvk.xxxx.yyy/svn/foo/trunk/ptj-src/']
encoding: 'ISO-8859-15', fsenc: 'ISO-8859-15', lang: 'fi_FI@euro'
plugins:
  bzrtools /usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools [0.92.0]
  launchpad /usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.4/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
  svn /usr/lib/python2.4/site-packages/bzrlib/plugins/svn [0.4.4]

** Please send this report to <email address hidden>
   with a description of what you were doing when the
   error occurred.

environment coLinux - debian unstable

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Can you perhaps provide a simple bzr branch that demonstrates this behaviour?

Revision history for this message
howari (mla-plenware) wrote :

Jelmer: sorry, tested a bit more and bzr-svn does not fail to that
 kind of filename even with my bizarre coLinux setup.

So this error is something else. It just showed nicely in the errormessage,
so i thought is was the obvious reason :)

Could this be somekind of out memory error? I've allocated 256 Megs of memory
to coLinux and swap about the same. But running only couple of ssh- bash sessions.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Can you still reproduce the bug with the original branch?

Revision history for this message
howari (mla-plenware) wrote :

Yes, it still fails with same error
bzr: ERROR: exceptions.KeyError: 'PTJ_k\xc3\xa4ytt\xc3\xb6ohje.pdf'
and I Increassed the memory 512M + 512 swap

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Can you retry with BZR_PDB=1 as environment variable set?

that should put you into the python debugger. In the python debugger, please run:

print self.revnum
print old_path

Revision history for this message
howari (mla-plenware) wrote :

**** entering debugger
> /usr/lib/python2.4/site-packages/bzrlib/plugins/svn/fetch.py(136)_get_old_id()
-> return self.old_inventory[parent_id].children[urlutils.basename(old_path)].file_id
(Pdb) print self.revnum
1546
(Pdb) print old_path
doc/PTJ_kÀyttöohje.pdf
(Pdb)

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

David, is the repository you get this error on public?

Revision history for this message
dfoerster (dfoerster-deactivatedaccount) wrote : Re: [Bug 162368] Re: bzr branch fails with foreign filenames

> David, is the repository you get this error on public?

No. And unfortunately the concerned repository contains sensitive information.

Revision history for this message
dfoerster (dfoerster-deactivatedaccount) wrote : Fix

The problem was the inconsistent use of strings and unicode objects as keys. The attached patch fixes that and adds a bunch of assertions to document and ensure the expected parameter types.

I was only able to test the checkout due to the memory problems.

Regards, David

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 162368] Fix

Am Donnerstag, den 10.01.2008, 00:00 +0000 schrieb dfoerster:
> The problem was the inconsistent use of strings and unicode objects as
> keys. The attached patch fixes that and adds a bunch of assertions to
> document and ensure the expected parameter types.
>
> I was only able to test the checkout due to the memory problems.
Thanks for the patch. I think however that this needs a more structural
solution, we need policy as to what type various paths/oids are in.
There are several other open bugs wrt the treatment of unicode
characters

Cheers,

Jelmer
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Applied with some modifications, thanks.

Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
Changed in bzr:
status: Fix Released → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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