create-node error when ~/.tahoe already exists #2088

Open
opened 2013-09-28 19:26:14 +00:00 by jbark55 · 4 comments
jbark55 commented 2013-09-28 19:26:14 +00:00
Owner

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.

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.
tahoe-lafs added the
unknown
normal
defect
1.10.0
labels 2013-09-28 19:26:14 +00:00
tahoe-lafs added this to the undecided milestone 2013-09-28 19:26:14 +00:00
jbark55 commented 2013-09-28 20:49:35 +00:00
Author
Owner

sent from the GNU 30th Birthday!

sent from the GNU 30th Birthday!

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.

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.
zooko added
code-frontend-cli
and removed
unknown
labels 2013-09-29 03:11:07 +00:00
daira commented 2013-10-01 17:42:16 +00:00
Author
Owner

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.)

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.)
tahoe-lafs modified the milestone from undecided to soon 2013-10-01 17:42:16 +00:00

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.

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.
warner changed title from create-node problem to create-node error when ~/.tahoe already exists 2016-04-28 07:13:50 +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#2088
No description provided.