ErrorFromSmartServer should not cause a traceback

Bug #263527 reported by Andrew Bennetts
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Andrew Bennetts

Bug Description

Bug 263506 mentions a case where a bzr server has a bug causing it to send an unexpected error response to the client. The client currently gives a traceback in this case, e.g.:

"""
$ bzr commit -m 'selftest --starting-with now accepts multiple values'
Committing to: bzr+ssh://bazaar.launchpad.net/~vila/bzr/bzr.integration2/
modified NEWS
modified bzrlib/builtins.py
modified bzrlib/tests/__init__.py
modified bzrlib/tests/test_selftest.py
modified bzrlib/tests/blackbox/test_selftest.py
Committed revision 3669.
bzr: ERROR: bzrlib.errors.ErrorFromSmartServer: Error received from smart server: ('error', "<Fault 8002: 'error'>")

Traceback (most recent call last):
  File "/v/home/vila/src/bzr/trunk/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/v/home/vila/src/bzr/trunk/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/v/home/vila/src/bzr/trunk/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Volumes/home/vila/src/bzr/trunk/bzrlib/builtins.py", line 2318, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/v/home/vila/src/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/v/home/vila/src/bzr/trunk/bzrlib/workingtree_4.py", line 242, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/v/home/vila/src/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/v/home/vila/src/bzr/trunk/bzrlib/mutabletree.py", line 197, in commit
    revprops=revprops, *args, **kwargs)
  File "/v/home/vila/src/bzr/trunk/bzrlib/commit.py", line 416, in commit
    self._cleanup()
  File "/v/home/vila/src/bzr/trunk/bzrlib/commit.py", line 600, in _cleanup
    raise e
ErrorFromSmartServer: Error received from smart server: ('error', "<Fault 8002: 'error'>")

bzr 1.7dev on python 2.5.2 (linux2)
...
"""

It's correct that ErrorFromSmartServer is raised if the error response could not be recognised. However the problem in this situation is almost certainly going to be in the server, not the client, so there's no good reason to show a traceback to the user of the client.

That is, the right output in that example would be just:

"""
$ bzr commit -m 'selftest --starting-with now accepts multiple values'
Committing to: bzr+ssh://bazaar.launchpad.net/~vila/bzr/bzr.integration2/
modified NEWS
modified bzrlib/builtins.py
modified bzrlib/tests/__init__.py
modified bzrlib/tests/test_selftest.py
modified bzrlib/tests/blackbox/test_selftest.py
Committed revision 3669.
bzr: ERROR: bzrlib.errors.ErrorFromSmartServer: Error received from smart server: ('error', "<Fault 8002: 'error'>")
"""

Tags: hpss
Revision history for this message
Andrew Bennetts (spiv) wrote :

This should be easy; I'll do this for 1.7.

Changed in bzr:
assignee: nobody → spiv
importance: Undecided → Medium
milestone: none → 1.7
Revision history for this message
John A Meinel (jameinel) wrote :

Shouldn't this be as simple as marking the exception as "internal_error = False" ?

Changed in bzr:
status: New → In Progress
Revision history for this message
Andrew Bennetts (spiv) wrote :

I've sent a patch to this to the list.

Changed in bzr:
status: In Progress → Fix Committed
Revision history for this message
Andrew Bennetts (spiv) wrote :

Fixed in bzr.dev, and the fix will be included in 1.7.

Changed in bzr:
status: Fix Committed → 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.