KeyError in transport close _file_streams while pulling into a bound branch

Bug #209689 reported by Martin Pool
14
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Unassigned

Bug Description

mbp@lithe% bzr pull bzr+ssh://bazaar.launchpad.net/~bzr/bzrtools/packaging-feisty/
bzr: ERROR: exceptions.KeyError: 'bzr+ssh://bazaar.launchpad.net/%7Ebzr/bzrtools/packaging-gutsy/.bzr/repository/upload/rllz2uvavcwow19nxvr8.pack'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 652, in run
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1570, in pull
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1717, in pull
    master_branch.unlock()
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 1390, in unlock
    self._real_branch.unlock()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1346, in unlock
    self.repository.unlock()
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 609, in unlock
    self._real_repository.unlock()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 2073, in unlock
    self.abort_write_group()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 482, in abort_write_group
    self._abort_write_group()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1850, in _abort_write_group
    self._pack_collection._abort_write_group()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1654, in _abort_write_group
    self._new_pack.abort()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 318, in abort
    self.write_stream.close()
  File "/usr/lib/python2.5/site-packages/bzrlib/transport/__init__.py", line 281, in close
    del _file_streams[self.transport.abspath(self.relpath)]
KeyError: 'bzr+ssh://bazaar.launchpad.net/%7Ebzr/bzrtools/packaging-gutsy/.bzr/repository/upload/rllz2uvavcwow19nxvr8.pack'

bzr 1.3 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'pull', 'bzr+ssh://bazaar.launchpad.net/~bzr/bzrtools/packaging-feisty/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.UTF-8'
plugins:
  gtk /home/mbp/.bazaar/plugins/gtk [0.92.0dev0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  pqm /home/mbp/.bazaar/plugins/pqm [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

This seems to be different to bug 191409 but might be related. maybe a problem in exception cleanup.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I just ran into this with bzr 1.5. Here's a shell script that reproduces the bug:

#!/bin/sh
set -e
cd "`mktemp -d`"
DIR=$PWD
mkdir local
cd local
bzr init .
echo test > file1
bzr add
bzr ci -m "Commit"
bzr push bzr+ssh://localhost/$DIR/remote1
bzr bind bzr+ssh://localhost/$DIR/remote1
cd ..
bzr branch remote1 remote2
cd remote2
echo test > file2
bzr add
bzr ci -m "Commit"
cd ../local
bzr pull bzr+ssh://localhost/$DIR/remote2

# Note that if I use ../remoteX instead of bzr+ssh://localhost/..., the crash doesn't happen.

Revision history for this message
Alastair Rankine (arankine) wrote :

Just verified that this bug seems to be fixed, for me at least, as of bzr 1.9.

Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Fix Released
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.