#2088 new defect

create-node error when ~/.tahoe already exists

Reported by: jbark55 Owned by: warner
Priority: normal Milestone: soon
Component: code-frontend-cli Version: 1.10.0
Keywords: usability new-user easy error Cc:
Launchpad Bug:

Description (last modified by zooko)

I tried to create a node and it says

$ tahoe create-node
The base directory '/home/jonathanbarker/.tahoe' is not empty.
To avoid clobbering anything, I am going to quit now.
Please use a different directory, or empty this one.

so i mkdir'ed a new dir and cd'ed into it, still problem.

Change History (8)

comment:1 Changed at 2013-09-28T19:47:37Z by zooko

  • Description modified (diff)

comment:2 Changed at 2013-09-28T20:49:35Z by jbark55

sent from the GNU 30th Birthday!

comment:3 Changed at 2013-09-29T03:11:07Z by zooko

  • Component changed from unknown to code-frontend-cli
  • Keywords usability new-user brians-opinion-needed added
  • Owner changed from daira to warner

I was watching over jbark55's shoulder, and I could tell that he assumed "create node" would create a node in the current working directory.

So how can we solve this?

Option (a): Make the error message more explicit. It already has the information in it! But maybe redundantly adding the information would have let jbark55 notice the information in the message, like this:

$ tahoe create-node
Attempting to create node in the default directory '/home/jonathanbarker/.tahoe'.
The base directory '/home/jonathanbarker/.tahoe' is not empty.
To avoid clobbering anything, I am going to quit now.
Please use a different directory, or empty this one.

Note that this kind of redundancy-adding is definitely contrary to the preference for succinctness and non-redundancy that Brian has often expressed in the past, so I would hesitate to do this without some kind of approval from Brian. (*Zooko goes and adds brians-opinion-needed to this ticket.*) }}}

Option (b): stop having a default directory for "tahoe create-node"! How often do you want to create a node in a default directory, anyway? I don't like defaults in general, and prefer to require people to specify explicitly what they want, even though that is more verbose and more typing. So in Option (b) it would say:

$ tahoe create-node
Usage:  tahoe [global-opts] create-node [options] NODEDIR
Options:
      --no-storage   Do not offer storage service to other nodes.
  -C, --basedir=     Same as --node-directory (default /home/zooko/.tahoe).
  -n, --nickname=    Specify the nickname for this node.
  -i, --introducer=  Specify the introducer FURL to use.
  -p, --webport=     Specify which TCP port to run the HTTP interface on. Use
                     'none' to disable. [default: tcp:3456:interface=127.0.0.1]
      --version      
      --help         Display this help and exit.

/home/zooko/playground/LAFS/tahoe-lafs/support/bin/tahoe:  Wrong number of arguments.

$ tahoe create-node .
Node created in '/home/jonathanbarker/newemptydirectory'
 Please set [client]introducer.furl= in tahoe.cfg!
 The node cannot connect to a grid without it.
 Please set [node]nickname= in tahoe.cfg


This is also somewhat opposed to the principle that the Brian-in-my-head has of conciseness, so I guess we need the real Brian to come back and weigh in. In my opinion, option (b) is fine and we should do it.

comment:4 Changed at 2013-09-29T03:23:18Z by zooko

  • Description modified (diff)

comment:5 Changed at 2013-09-29T03:23:31Z by zooko

  • Keywords easy added

comment:6 Changed at 2013-10-01T17:42:16Z by daira

  • Keywords error added
  • Milestone changed from undecided to soon

Perhaps we should print the usage message on an error? (This is done just by raising twisted.python.usage.error with the desired message, instead of directly printing it and exiting.)

comment:7 Changed at 2013-10-02T00:34:10Z by warner

  • Keywords brians-opinion-needed removed

I'd be ok with option A (the redundant information approach):

$ tahoe create-node
Attempting to create node in the default directory '/home/jonathanbarker/.tahoe'.
The base directory '/home/jonathanbarker/.tahoe' is not empty.
To avoid clobbering anything, I am going to quit now.
Please use a different directory, or empty this one.

Maybe even modifying that last line to say "Please add '-d OTHERDIR' to use a different directory".

I'm not so keen on option B, because it makes the common case more verbose, in favor of a less-common case. Most users will only ever deal with a single node, so using a default location like ~/.tahoe means less typing. If we removed the default, then every single tahoe command they typed would need to specify the basedir (tahoe -d BASEDIR ls, etc). I've watched Zooko be willing to type that much (dude, try typing just "make".. I bet you can't do it! :-) your fingers are hardwired to include some timing commands, redirect stdout to one place, stderr to some other place, etc), but I'm certainly not, and I don't want to impose that burden on our users.

Only developers (who launch multiple nodes at once, in self-contained test grids) are likely to need control over the basedir, and so it's reasonable for them/us to type more to get that control.

I'm -0 on printing the usage message on error in this particular case. Having "default ~/.tahoe" on the screen is good, but I fear that all that usage text will obscure the "this directory wasn't empty" message, and will make people think that they made some sort of syntax error in the arguments, rather than a conceptual error involving the placement/new-ness of the node directory.

comment:8 Changed at 2016-04-28T07:13:50Z by warner

  • Summary changed from create-node problem to create-node error when ~/.tahoe already exists
Note: See TracTickets for help on using tickets.