#121 closed defect (fixed)

handling errors in 'tahoe get'

Reported by: zooko Owned by: zooko
Priority: major Milestone: 1.6.0
Component: code-frontend-cli Version: 0.7.0
Keywords: reliability test news-done Cc:
Launchpad Bug:

Description

I just tried to download a file with

allmydata-tahoe get -u http://localhost:8080 THE_FILE_NAME foo

It said:

THE_FILE_NAME retrieved and written to foo

But the contents of foo are not the contents of the file. The contents of foo are:

[Failure instance: Traceback: <class 'allmydata.encode.NotEnoughPeersError'>:
/usr/local/stow/Twisted-2.5.0/lib/python2.5/site-packages/twisted/internet/defer.py:317:_runCallbacks
/usr/local/stow/Twisted-2.5.0/lib/python2.5/site-packages/twisted/internet/defer.py:507:_cbDeferred
/usr/local/stow/Twisted-2.5.0/lib/python2.5/site-packages/twisted/internet/defer.py:239:callback
/usr/local/stow/Twisted-2.5.0/lib/python2.5/site-packages/twisted/internet/defer.py:304:_startRunCallbacks
--- <exception caught here> ---
/usr/local/stow/Twisted-2.5.0/lib/python2.5/site-packages/twisted/internet/defer.py:317:_runCallbacks
/Users/wonwinmcbrootles/playground/allmydata/tahoe/instdir/lib/allmydata/download.py:373:_got_all_shareholders
]

Change History (16)

comment:1 Changed at 2007-09-19T23:01:20Z by zooko

  • Milestone changed from 0.6.0 to 0.7.0

comment:2 Changed at 2007-10-11T10:24:10Z by warner

can you retest this with 0.6.0? I think I might have improved something here between 0.5.0 and 0.6.0 . The HTTP response should definitely not be '200 OK', and the 'get' client needs to notice that and avoid writing anything to the target file when that happens (in that case, the body will contain some sort of useful error message).

comment:3 Changed at 2007-10-18T23:27:42Z by zooko

  • Milestone changed from 0.7.0 to 0.6.2
  • Status changed from new to assigned
  • Version changed from 0.5.0 to 0.6.1

comment:4 Changed at 2007-11-01T17:24:50Z by zooko

  • Milestone changed from 0.6.2 to 0.7.1

We're focussing on an imminent v0.7.0 (see the roadmap) which hopefully has Small Distributed Mutable Files and also a fix for bad SHA-256. So I'm bumping less urgent tickets to v0.7.1.

comment:5 Changed at 2007-11-13T18:23:36Z by zooko

  • Milestone changed from 0.7.1 to 0.7.2
  • Version changed from 0.6.1 to 0.7.0

We need to choose a manageable subset of desired improvements for v0.7.1, scheduled for two week hence, so I'm bumping this one into v0.7.2, scheduled for mid-December.

comment:6 Changed at 2008-01-15T21:36:30Z by zooko

  • Component changed from code-frontend to code-frontend-cli

comment:7 Changed at 2008-01-23T04:19:10Z by zooko

  • Milestone changed from 0.7.2 to undecided

comment:8 Changed at 2009-02-26T19:16:14Z by warner

  • Milestone changed from eventually to 1.4.0
  • Summary changed from command-line: handling errors to handling errors in 'tahoe get'

I just tested 1.3.0 (actually trunk as of 9ab4aa9016bb65dc), and there's still a problem, but a different one. tahoe get my:unrecoverable LOCAL (on a file with only two shares, using 3-of-10) results in an empty file named LOCAL being created, and an ugly HTML representation of an UnrecoverableFileError being written to stderr. The process exit status is 1.

The two bugs:

  • LOCAL should not be created
  • the HTML traceback should not be printed, instead "UnrecoverableFileError" and perhaps a short message should be written to stderr

comment:9 Changed at 2009-06-30T16:57:29Z by zooko

  • Milestone changed from 1.5.0 to eventually

comment:10 Changed at 2009-12-20T01:23:53Z by davidsarah

  • Keywords reliability added

comment:11 Changed at 2009-12-27T22:17:18Z by warner

  • Milestone changed from eventually to 1.6.0
  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed. 931ab76588dab261 stops opening the output file until we get a success response (removing the empty file), and UnrecoverableFileError has been mapped into a nicer human-readable string since maybe 1.4.0 or so.

comment:12 Changed at 2009-12-27T23:46:02Z by davidsarah

  • Keywords test added
  • Resolution fixed deleted
  • Status changed from closed to reopened

The change in 931ab76588dab261 is to not explicitly close the file on error. But don't open files get implicitly closed on process exit?

POSIX says they do when exit() is called: "The exit() function shall then flush all open streams with unwritten buffered data." Python will usually call exit().

If I'm wrong, convince me with a unit test :-)

comment:13 Changed at 2009-12-27T23:49:49Z by davidsarah

Sorry, I misread the diff. The file is not opened if there is an error. A unit test would still be nice, though.

comment:14 Changed at 2009-12-28T00:01:51Z by warner

a50fdca6ab88e6b0: your wish is my command :-)

comment:15 Changed at 2009-12-28T00:15:20Z by davidsarah

  • Resolution set to fixed
  • Status changed from reopened to closed

That was quick. Test looks good.

comment:16 Changed at 2010-02-02T05:53:00Z by davidsarah

  • Keywords news-done added
Note: See TracTickets for help on using tickets.