Give a clean message and hint for zlib.error

Bug #453768 reported by Mark Grandi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

I was using bzr locally, now i uploaded the folder to my ftp server, and unbound my branch (that i keep on my usb key and commit to the main one) and rebound it to my ftp folder, but when i try to run "bzr commit -m "blah" " it crashes.

Attached is the console output, bzr --version and ~/.bzr.log

5.677 Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 842, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1037, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 654, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/site-packages/bzrlib/builtins.py", line 3051, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/usr/lib/python2.6/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/workingtree_4.py", line 197, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/mutabletree.py", line 194, in commit
    possible_master_transports)
  File "/usr/lib/python2.6/site-packages/bzrlib/branch.py", line 245, in _get_nick
    return master.nick
  File "/usr/lib/python2.6/site-packages/bzrlib/branch.py", line 242, in _get_nick
    master = self.get_master_branch(possible_transports)
  File "/usr/lib/python2.6/site-packages/bzrlib/decorators.py", line 136, in read_locked
    self.lock_read()
  File "/usr/lib/python2.6/site-packages/bzrlib/branch.py", line 2152, in lock_read
    self.repository.lock_read()
  File "/usr/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 2317, in lock_read
    self._refresh_data()
  File "/usr/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 2256, in _refresh_data
    self._pack_collection.reload_pack_names()
  File "/usr/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 1980, in reload_pack_names
    first_read = self.ensure_loaded()
  File "/usr/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 1648, in ensure_loaded
    for index, key, value in self._iter_disk_pack_index():
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 935, in iter_all_entries
    if not self.key_count():
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 1383, in key_count
    self._get_root_node()
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 879, in _get_root_node
    self._get_internal_nodes([0])
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 904, in _get_internal_nodes
    return self._get_nodes(self._internal_node_cache, node_indexes)
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 896, in _get_nodes
    found.update(self._get_and_cache_nodes(needed))
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 686, in _get_and_cache_nodes
    for node_pos, node in self._read_nodes(sorted(nodes)):
  File "/usr/lib/python2.6/site-packages/bzrlib/btree_index.py", line 1500, in _read_nodes
    bytes = zlib.decompress(data)
error: Error -5 while decompressing data

Revision history for this message
Mark Grandi (markgrandi) wrote :
Revision history for this message
Mark Grandi (markgrandi) wrote :
Revision history for this message
Mark Grandi (markgrandi) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

zlib.h has

#define Z_BUF_ERROR (-5)

I would guess this indicates some kind of disk-level corruption. If you have a copy of the repository locally, try renaming the one on the ftp server and re-pushing it.

Changed in bzr:
status: New → Incomplete
description: updated
Revision history for this message
Mark Grandi (markgrandi) wrote :

Yeah, that makes sense as I just kinda reuploaded the branch to my FTP server and it ended up working fine after that.

I guess the point of this bug is, is there a more graceful way of handling this error, instead of Bazaar explorer crashing and possibly a scary python traceback output in the terminal?

Martin Pool (mbp)
summary: - bzr: ERROR: zlib.error: Error -5 while decompressing data
+ Give a clean message and hint for zlib errors
Changed in bzr:
importance: Undecided → Wishlist
status: Incomplete → Confirmed
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 453768] Re: bzr: ERROR: zlib.error: Error -5 while decompressing data

On 18 February 2010 03:30, Mark Grandi <email address hidden> wrote:
> Yeah, that makes sense as I just kinda reuploaded the branch to my FTP
> server and it ended  up working fine after that.
>
> I guess the point of this bug is, is there a more graceful way of
> handling this error, instead of Bazaar explorer crashing and possibly a
> scary python traceback output in the terminal?

We could catch this error and point you to a faq. However if things
are breaking underneath us at the disk or OS level, as does sometimes
happen, it's pretty hard to predict precisely what will fail. If this
particular error turns out to be common perhaps we should handle it
that way.

--
Martin <http://launchpad.net/~mbp/>

summary: - Give a clean message and hint for zlib errors
+ Give a clean message and hint for zlib.error
tags: added: traceback
Revision history for this message
Tim Black (tim-alwaysreformed) wrote :

I get the same error when attempting bzr commit -m .... in a folder mounted via sshfs. I'm guessing the problem is that at some point sshfs fails to allow one particular read or write operation (and maybe wants bzr to try again).

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.