AttributeError: TahoeError instance has no attribute 'args' #808

Closed
opened 2009-09-24 03:44:13 +00:00 by zooko · 4 comments

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'
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' ```
zooko added the
code-frontend-cli
major
defect
1.4.1
labels 2009-09-24 03:44:13 +00:00
zooko added this to the undecided milestone 2009-09-24 03:44:13 +00:00
Author

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.

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.

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.

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.
tahoe-lafs modified the milestone from undecided to 1.7.0 2010-04-04 16:55:39 +00:00
zooko modified the milestone from 1.7.0 to eventually 2010-06-18 23:32:31 +00:00
davidsarah commented 2011-08-16 05:06:37 +00:00
Owner

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
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 ```
tahoe-lafs added the
fixed
label 2011-08-16 05:06:37 +00:00
tahoe-lafs modified the milestone from eventually to 1.8.2 2011-08-16 05:06:37 +00:00
davidsarah commented 2011-08-16 05:25:59 +00:00
Owner

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 changeset:80252debcd94fc28 and changeset: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]source:src/allmydata/scripts/common_http.py@4435#L84 and [MissingSourceError]source:src/allmydata/scripts/tahoe_cp.py@4435#L30 also call TahoeError.*init*.

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 changeset:80252debcd94fc28 and changeset: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]source:src/allmydata/scripts/common_http.py@4435#L84 and [MissingSourceError]source:src/allmydata/scripts/tahoe_cp.py@4435#L30 also call `TahoeError.*init*`.
tahoe-lafs modified the milestone from 1.8.2 to 1.7.1 2011-08-16 05:25:59 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#808
No description provided.