Commit in checkout crashes with KeyError: <type 'NoneType'>

Bug #434230 reported by Alexandros Frantzis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

I created a local svn repository to experiment and added some revisions using svn. I then created a checkout of the only directory in the repository. Every time I try to commit to the checkout I get a crash. Note that the revision is actually commited to the svn repository. Also note that after the crash I need to "bzr up" to get my checkout up-to-date.

The crash can be seen both in bzr 1.17 + bzr-svn 0.6.5 and bzr 2.0rc2 + bzr-svn 1.0rc1. Below are the tracebacks for both combinations:
======================= bzr1.17 ====================
bzr: ERROR: exceptions.TypeError: unsupported type None

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3043, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 197, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 228, in commit
    *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 390, in commit
    self.branch.repository, new_revno, self.rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/branch.py", line 500, in import_last_revision_info
    self.get_push_merged_revisions(), overwrite=False)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/push.py", line 214, in push_branch
    overwrite=overwrite)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/push.py", line 236, in push
    override_svn_revprops=target_config.get_override_svn_revprops())
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/push.py", line 150, in push_revision_tree
    revid = builder.commit(rev.message)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/errors.py", line 134, in convert
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/commit.py", line 847, in commit
    logcache.insert_revprops(result_revision, self._svn_revprops, True)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/cache/tdbcache.py", line 260, in insert_revprops
    self.db["revprops/%d" % revision] = bencode.bencode((revprops, all_revprops))
  File "_bencode_pyx.pyx", line 391, in bzrlib._bencode_pyx.bencode
  File "_bencode_pyx.pyx", line 375, in bzrlib._bencode_pyx.Encoder.process
  File "_bencode_pyx.pyx", line 339, in bzrlib._bencode_pyx.Encoder._encode_list
  File "_bencode_pyx.pyx", line 377, in bzrlib._bencode_pyx.Encoder.process
  File "_bencode_pyx.pyx", line 357, in bzrlib._bencode_pyx.Encoder._encode_dict
  File "_bencode_pyx.pyx", line 383, in bzrlib._bencode_pyx.Encoder.process
TypeError: unsupported type None

bzr 1.17 on python 2.5.4 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.17]
  diffstat /home/alf/.bazaar/plugins/diffstat [0.2]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.96.2.final]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.17]
  loom /usr/lib/python2.5/site-packages/bzrlib/plugins/loom [1.4dev]
  netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.17]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.5.4dev]
  svn /usr/lib/python2.5/site-packages/bzrlib/plugins/svn [0.6.5]
*** 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

======================== bzr 2.0rc2 ========================
bzr: ERROR: exceptions.KeyError: <type 'NoneType'>

Traceback (most recent call last):
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/commands.py", line 842, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/commands.py", line 1037, in run_bzr
    ret = run(*run_argv)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/commands.py", line 654, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/builtins.py", line 3051, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/workingtree_4.py", line 197, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/mutabletree.py", line 228, in commit
    *args, **kwargs)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/commit.py", line 393, in commit
    self.branch.repository, new_revno, self.rev_id)
  File "/home/alf/.bazaar/plugins/svn/branch.py", line 500, in import_last_revision_info
    self.get_push_merged_revisions(), overwrite=False)
  File "/home/alf/.bazaar/plugins/svn/push.py", line 214, in push_branch
    overwrite=overwrite)
  File "/home/alf/.bazaar/plugins/svn/push.py", line 236, in push
    override_svn_revprops=target_config.get_override_svn_revprops())
  File "/home/alf/.bazaar/plugins/svn/push.py", line 150, in push_revision_tree
    revid = builder.commit(rev.message)
  File "/home/alf/.bazaar/plugins/svn/errors.py", line 134, in convert
    return unbound(*args, **kwargs)
  File "/home/alf/.bazaar/plugins/svn/commit.py", line 847, in commit
    logcache.insert_revprops(result_revision, self._svn_revprops, True)
  File "/home/alf/.bazaar/plugins/svn/cache/tdbcache.py", line 260, in insert_revprops
    self.db["revprops/%d" % revision] = bencode.bencode((revprops, all_revprops))
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/util/_bencode_py.py", line 160, in bencode
    encode_func[type(x)](x, r)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/util/_bencode_py.py", line 127, in encode_list
    encode_func[type(i)](i, r)
  File "/home/alf/Desktop/bzr-2.0rc2/bzrlib/util/_bencode_py.py", line 136, in encode_dict
    encode_func[type(v)](v, r)
KeyError: <type 'NoneType'>

bzr 2.0rc2 on python 2.5.4 (Linux-2.6.30-1-686-i686-with-debian-squeeze-sid)
arguments: ['/home/alf/Desktop/bzr-2.0rc2/bzr', 'commit']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /home/alf/Desktop/bzr-2.0rc2/bzrlib/plugins/launchpad [2.0rc2]
  netrc_credential_store /home/alf/Desktop/bzr-2.0rc2/bzrlib/plugins/netrc_credential_store [2.0rc2]
  rebase /home/alf/.bazaar/plugins/rebase [0.5.4dev]
  svn /home/alf/.bazaar/plugins/svn [1.0rc1]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Related branches

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

I also tried this using a branch instead of a checkout and I get the same crash when using either "push" or "dpush".

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Upon further investigation this seems to happen when revisions in the svn repository don't have an author (eg anonymous writes are allowed in the svn repository).

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

Should be fixed in the 1.0 branch now. If it isn't, please let me know.

Changed in bzr-svn:
status: New → Won't Fix
status: Won't Fix → Fix Released
importance: Undecided → Low
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

If you can still reproduce it, do you perhaps have any special settings for bzr-svn in ~/.bazaar/bazaar.conf?

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

I tried the latest bzr-svn with both bzr 1.17 and bzr 2.0rc2 and can't reproduce the issue. Thanks!

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

Thanks for confirming.

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.