[tahoe-dev] [tahoe-lafs] #776: users are confused by "tahoe rm"

tahoe-lafs trac at allmydata.org
Tue Jul 28 03:10:07 UTC 2009


#776: users are confused by "tahoe rm"
-------------------------------+--------------------------------------------
 Reporter:  zooko              |           Owner:           
     Type:  defect             |          Status:  new      
 Priority:  major              |       Milestone:  undecided
Component:  code-frontend-cli  |         Version:  1.4.1    
 Keywords:                     |   Launchpad_bug:           
-------------------------------+--------------------------------------------
 I found the following conversation log between a new user (!PovAddict) and
 an experienced user (soul9).  They are confused about what "tahoe rm"
 means.  Possible changes that could improve this include renaming it to
 "tahoe unlink", improving the error messages (see below), and improving
 the docs.

 {{{
 <PovAddict> I just installed a tahoe client and attached it to the
 "volunteer grid"
 [19:01]
 ...
 <PovAddict> also, too many Python exceptions to take tahoe seriously...
 [19:17]
 <soul9> PovAddict: what python exceptions.
 [19:19]
 <soul9> ?
 <soul9> python2.6?
 <PovAddict> 2.5.2
 <soul9> hm
 <soul9> i didn't have python exceptions, except deprecationwarnings in
 python
         2.6
 <PovAddict> http://pastebin.com/df3bfddf
 [19:20]

       nicolas at ubuntu /tmp/tahoe-c$ ~/src/allmydata-tahoe-1.4.1/bin/tahoe
 ls
       Traceback (most recent call last):
         File "/home/nicolas/src/allmydata-tahoe-1.4.1/support/bin/tahoe",
 line 8, in <module>
           load_entry_point('allmydata-tahoe==1.4.1', 'console_scripts',
 'tahoe')()
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 91, in run
           rc = runner(sys.argv[1:])
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 78, in runner
           rc = cli.dispatch[command](so)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/cli.py", line 380, in list
           rc = tahoe_ls.list(options)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/tahoe_ls.py", line 18, in list
           rootcap, path = get_alias(aliases, where, DEFAULT_ALIAS)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/common.py", line 148, in get_alias
           return aliases[default], path
       KeyError: 'tahoe'
       nicolas at ubuntu /tmp/tahoe-c$ ~/src/allmydata-tahoe-1.4.1/bin/tahoe
 ls
 URI:CHK:2nxmn6eew3y5e5y7ejzwfr2jiq:6mi2hcbpuvkfcttuezi4x3fxwrnmwidql2rtwwtczpccxgz3ez2q:3:10:310946
       Traceback (most recent call last):
         File "/home/nicolas/src/allmydata-tahoe-1.4.1/support/bin/tahoe",
 line 8, in <module>
           load_entry_point('allmydata-tahoe==1.4.1', 'console_scripts',
 'tahoe')()
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 91, in run
           rc = runner(sys.argv[1:])
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 78, in runner
           rc = cli.dispatch[command](so)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/cli.py", line 380, in list
           rc = tahoe_ls.list(options)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/tahoe_ls.py", line 67, in list
           childtype = child[0]
       KeyError: 0
       nicolas at ubuntu /tmp/tahoe-c$ ~/src/allmydata-tahoe-1.4.1/bin/tahoe
 rm
 URI:CHK:2nxmn6eew3y5e5y7ejzwfr2jiq:6mi2hcbpuvkfcttuezi4x3fxwrnmwidql2rtwwtczpccxgz3ez2q:3:10:310946
       Traceback (most recent call last):
         File "/home/nicolas/src/allmydata-tahoe-1.4.1/support/bin/tahoe",
 line 8, in <module>
           load_entry_point('allmydata-tahoe==1.4.1', 'console_scripts',
 'tahoe')()
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 91, in run
           rc = runner(sys.argv[1:])
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/runner.py", line 78, in runner
           rc = cli.dispatch[command](so)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/cli.py", line 409, in rm
           rc = tahoe_rm.rm(options)
         File "/home/nicolas/src/allmydata-
 tahoe-1.4.1/src/allmydata/scripts/tahoe_rm.py", line 25, in rm
           assert path
       AssertionError

 <PovAddict> I uploaded a file to the VolunteerGrid from the web interface
 <PovAddict> I can download it back from there, or using "tahoe get"
 <soul9> yes, well
 <PovAddict> and that's it; is 'rm' supposed to work?
 <soul9> i think that has to do with a not defined default rootcap
 [19:21]
 <soul9> yes, it is, of course
 <PovAddict> no matter what the problem really is, the command line tool
 should
             give a proper error message, instead of dumping a
 stacktrace...
 <soul9> er
 [19:22]
 <PovAddict> "KeyError: 0" might only mean something to people who know the
             code and know the causes of this situation
 <PovAddict> definitely means nothing to me
 <soul9> it's not dumping it's core at all
 <PovAddict> it printed a stacktrace on the console
 [19:23]
 <soul9> it's trying to tell you you didn't give it where to ls
 <soul9> no, that's warnings
 <soul9> if you don't want that do tahoe cmd ... blabla 2> /dev/null
 <PovAddict> "KeyError: 0" and "AssertionError" are not warnings, they are
             exceptions
 [19:24]
 <soul9> they end in error because there is nothing to ls
 <soul9> tahoe has no "root"
 <soul9> so you can't do an ls without giving it a default rootcap
 <PovAddict> my point is: why does it say "KeyError: 0" instead of "rootcap
             required"?
 <soul9> which is the tahoe "alias"
 <PovAddict> is it an argument I'm supposed to pass after 'ls'?
 [19:25]
 <soul9> well, that's a good point, and you should definitely open a bug if
         there isn't one allready
 <PovAddict> "tahoe ls something"?
 <soul9> tahoe ls ROOT:cap:thisisasecuretahoeurlwhateverhexblah
 <soul9> yeah, it's an tahoe rootcap
 <PovAddict> "tahoe ls --help" doesn't say there are required arguments
 [19:26]
 <soul9> so e.g. you do tahoe mkdir foo
 <soul9> gives you a rootcap back
 <soul9> then you can save the rootcap as an alias
 <soul9> so you don't need to remember the horridly long hash
 <soul9> you can give it a name
 <soul9> because if you add an tahoe alias
 <soul9> then that will be used as default
 <PovAddict> okay, actually, --help doesn't even mention any argument
 [19:27]
 <PovAddict> just the options
 <soul9> which is why it's looking for the tahoe key
 <PovAddict> and "tahoe <command> [command options] mkdir [options]" makes
 no
             sense :) mkdir *is* the <command>
 <PovAddict> anyway; what about the rm error?
 * soul9 → bugs
 <soul9> try it with a rootcap
 [19:28]
 <soul9> it'll work
 <soul9> tahoe is well coded for the purpose it serves
 <soul9> wich is uploading big files using the web ui
 <soul9> because the cmdline client also just uses the webui in the backend
 [19:29]
 <soul9> hell, the fuse client just uses the webui aswell
 <PovAddict> I don't know how I'm supposed to get that 'rootcap'
 <PovAddict> I uploaded a file from the web ui, now I want to delete it
 *** jsgf (n=jeremy at adsl-69-107-65-92.dsl.pltn13.pacbell.net) has quit:
 Read
     error: 110 (Connection timed out)
 <PovAddict> I have the URI I got after uploading
 [19:30]
 <soul9> that's the cap
 <PovAddict> and I can use it to download the file
 <soul9> that big hash
 <PovAddict> yup
 <soul9> so you do tahoe rm HASH
 <soul9> tahoe ls HASH
 <PovAddict> and it throws an AssertionError, as shown on my paste
 [19:31]
 <soul9> tahoe cp foo HASH:dor/you/want
 <soul9> hm
 [19:32]
 <soul9> dunno
 <soul9> worksforme™
 <PovAddict> also note line 16 of paste was wrapped; I *did* pass a hash to
 ls
 <PovAddict> and it just throws a different error
 [19:33]
 <soul9> then you have a problem in your setup, or the directory is empty
 <soul9> iirc
 <PovAddict> I didn't create a directory
 [19:34]
 <PovAddict> I uploaded it from here: http://nooxie.zooko.com:9798/ using
 the
             "Upload a file" form, I didn't create a directory first
 [19:35]
 <PovAddict> unfortunately none of the shares ended up on my own node,
 which is
             kind of what I wanted to try
 [19:36]
 <PovAddict> so, now, I want to delete the file from the grid; and I only
 have
             the one hash it gave me
 <soul9> yeah, tahoe ls file doesn't work
 [19:38]
 <soul9> you can't ls a file
 <soul9> use the hash to delete it
 <soul9> it's as simple as tahoe rm HASH
 <PovAddict> I did and it throws AssertionError
 <PovAddict> the hash is in the pastebin; can you try rm yourself?
 <soul9> is the file still there tho?
 [19:39]
 <soul9> i'm not connected to the volounteer grid
 <soul9> i have my own ;)
 <PovAddict> 'check' says the file is healthy
 <PovAddict> Summary: Healthy
 <soul9> weird, it should work
 <PovAddict>  storage index: xetcmqax6bi5eozzggamxh7gg4
 [19:40]
 <PovAddict>  good-shares: 10 (encoding is 3-of-10)
 <soul9> mmmm
 [19:41]
 <soul9> º what is the introducer furl to the volounteer grid?
 [19:42]
 <PovAddict>
 pb://6cypm5tfsv6ag43g3j5z74qx5nfxa2qq@207.7.145.200:64228,nooxie.zooko.com:64228/introducer
 <soul9> mm
 [19:45]
 <soul9> that's a bug!
 [19:46]
 <soul9> can't rm it
 <soul9> :D
 <PovAddict> too bad the contest is about hacking tahoe and not just
 breaking
             it :)
 [19:47]
 <soul9> :D
 <soul9> include that hash in the bugreport
 [19:49]
 <soul9> what version of tahoe are you using
 <soul9> ?
 <PovAddict> 1.4.1
 <PovAddict> I'm currently running it under a debugger, stepping through
             get_alias
 [19:50]
 <PovAddict> ok so, if the path starts with "URI: but doesn't contain
 ":./",
             then get_alias returns "" for path
 [19:51]
 <PovAddict> and then 'assert path' explodes
 <soul9> really, this is weird man
 [19:52]
 <soul9> i have put stuff and deleted through the cmdline and the webui and
         mixes
 <soul9> never encountered this
 <PovAddict> I think I got it
 [19:53]
 <PovAddict> but I'll upload another file and try again
 <PovAddict> 'rm' seems not to be prepared to delete files out of
 directories...
 [20:03]
 <PovAddict> hmm looks like you can't delete files actually!
 [20:06]
 <PovAddict> "Note that this does not actually delete the file or directory
             that the name points to from the tahoe grid -- it only removes
 the
             named reference from this directory."
 [20:07]
 <PovAddict> the object will just become "unreachable" (but the data still
             there?) if no reachable directories have the file, and
 everybody
             loses the readcap
 [20:08]
 <PovAddict> so when do shares actually disappear?
 [20:10]
 <soul9> i think the crawxler is the garbage collector
 [20:14]
 }}}

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/776>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list