#808 closed defect (fixed)
AttributeError: TahoeError instance has no attribute 'args'
Reported by: | zooko | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.7.1 |
Component: | code-frontend-cli | Version: | 1.4.1 |
Keywords: | error tahoe-cp | Cc: | |
Launchpad Bug: |
Description
An allmydata.com user named "gar5" reported this stack trace from "tahoe cp --recursive --verbose":
examining 0 of 13 examining 1 of 13 examining 2 of 13 examining 3 of 13 examining 4 of 13 examining 5 of 13 examining 6 of 13 examining 7 of 13 examining 8 of 13 examining 9 of 13 examining 10 of 13 examining 11 of 13 examining 12 of 13 attaching sources to targets, 1 files / 0 dirs in root targets assigned, 1 dirs, 2 files starting copy, 2 files, 1 directories Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/runner.py", line 91, in run rc = runner(sys.argv[1:]) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/runner.py", line 78, in runner rc = cli.dispatch[command](so) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/cli.py", line 404, in cp rc = tahoe_cp.copy(options) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 759, in copy return Copier().do_copy(options) --- <exception caught here> --- File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 444, in do_copy self.try_copy() File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 501, in try_copy return self.copy_to_directory(sources, target) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 661, in copy_to_directory self.copy_files_to_target(self.targetmap[target], target) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 692, in copy_files_to_target self.copy_file_into(source, name, target) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 736, in copy_file_into f = source.open(self.caps_only) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 191, in open return GET_to_file(url) File "/usr/lib/python2.4/site-packages/allmydata_tahoe-1.4.1-py2.4.egg/allmydata/scripts/tahoe_cp.py", line 34, in GET_to_file raise TahoeError("Error during GET", resp) allmydata.scripts.tahoe_cp.TahoeError: <TahoeError instance at -1230407124 with str error Traceback (most recent call last): File "/usr/local/src/TahoeFS/allmydata-tahoe-1.4.1/Twisted-8.2.0-py2.4-linux-i686.egg/twisted/python/reflect.py", line 560, in safe_str return str(o) AttributeError: TahoeError instance has no attribute 'args'
Change History (6)
comment:1 Changed at 2009-10-15T16:40:21Z by zooko
comment:2 Changed at 2010-01-16T02:36:07Z by warner
Oops, yes, the TahoeError class in source:src/allmydata/scripts/tahoe_cp.py#L19 must either set self.args or override __str__ (and maybe __repr__). The error occurs when some other code attempts to str-ify one of these exceptions.
This is a CLI-side error-reporting bug. There must be a separate (but similiarly-shaped) bug in the webapi or wui code for #813.
comment:3 Changed at 2010-04-04T16:55:39Z by davidsarah
- Keywords error tahoe-cp added
- Milestone changed from undecided to 1.7.0
comment:4 Changed at 2010-06-18T23:32:31Z by zooko
- Milestone changed from 1.7.0 to eventually
comment:5 Changed at 2011-08-16T05:06:37Z by davidsarah
- Milestone changed from eventually to 1.8.2
- Resolution set to fixed
- Status changed from new to closed
This must have been fixed at some point. For tahoe cp --recursive --verbose, I now get a usage message and
/path/to/bin/tahoe: cp requires at least two arguments
comment:6 Changed at 2011-08-16T05:25:59Z by davidsarah
- Milestone changed from 1.8.2 to 1.7.1
Oh, I may have misinterpreted the ticket description; "tahoe cp --recursive --verbose" must not have been the complete command.
Nevertheless I believe this would have been fixed as a side-effect of 80252debcd94fc28 and 731e3d68dff0f8c9. Notice in http://tahoe-lafs.org/trac/tahoe-lafs/changeset/4435/trunk/src/allmydata/scripts/common.py that TahoeError calls the superclass Exception.__init__, which will set .args. Its subclasses HTTPError and MissingSourceError also call TahoeError.__init__.
Oh, this may be the same issue as #813 (string exception raised to web renderer?). It occurred at about the same time for the same user. I suspect this is the cli version of this bug and #813 is the wui version of this bug.