#1376 new defect

make user-oriented error message for absence of node.url — at Version 6

Reported by: zooko Owned by:
Priority: major Milestone: soon
Component: code-frontend-cli Version: 1.8.2
Keywords: cli usability tahoe-* doc error Cc:
Launchpad Bug:

Description (last modified by daira)

I created a basedir with tahoe create-client ${BASEDIR}, then started the client with tahoe start ${BASEDIR, then ran tahoe mkdir -d ${BASEDIR}, and it did this:

$ tahoe mkdir -d .
Traceback (most recent call last):
  File "/Users/zooko/playground/tahoe-lafs/dw/support/bin/tahoe", line 9, in <module>   
    load_entry_point('allmydata-tahoe==1.8.2-r5006', 'console_scripts', 'tahoe')()
  File "/Users/zooko/playground/tahoe-lafs/dw/src/allmydata/scripts/runner.py", line 113, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/Users/zooko/playground/tahoe-lafs/dw/src/allmydata/scripts/runner.py", line 67, in runner
    config.parseOptions(argv)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/twisted/python/usage.py", line 231, in parseOptions
    self.subOptions.parseOptions(rest)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/twisted/python/usage.py", line 241, in parseOptions
    self.postOptions()
  File "/Users/zooko/playground/tahoe-lafs/dw/src/allmydata/scripts/cli.py", line 42, in postOptions
    self['node-url'] = open(node_url_file, "r").read().strip()
IOError: [Errno 2] No such file or directory: u'/Users/zooko/tmp/d/tmp_create/node.url' 

There is no node.url file present. The usage information from tahoe mkdir --help makes it sound like the node.url file is not necessary if the actual Tahoe-LAFS gateway is there:

  -d, --node-directory=   Specify which Tahoe node directory should be used. The
                          directory should either contain a full Tahoe node, or
                          a file named node.url that points to some other Tahoe
                          node. It should also contain a file named
                          'private/aliases' which contains the mapping from
                          alias name to root dirnode URI. [default:
                          '/Users/zooko/.tahoe']

Change History (6)

comment:1 Changed at 2011-03-11T20:57:49Z by davidsarah

Isn't tahoe start ${BASEDIR} supposed to create node.url? Is the WUI working for that gateway?

comment:2 Changed at 2011-03-11T21:05:15Z by davidsarah

Oh, didn't see #1377. Is this bug invalid?

(The error message is horrible, but that is #1048 and #974.)

comment:3 Changed at 2011-03-11T21:34:23Z by zooko

  • Keywords doc added
  • Summary changed from CLI errors out due to absence of node.url to make user-oriented error message for absence of node.url

So the underlying cause was that the node didn't start due to port number conflict and it emitted output which made it look like it had started (#1377).

A secondary problem is that the --help text confused me about whether it should be able to run without node.url. After all, the node.url is only for finding the node, right? And the node directory is right there, right? And the help text said "either contain a full Tahoe node, or a file named node.url", and I thought that I had the first half of that disjunction. This theory doesn't hold up if you think about it (because even though the node's persistent state is right there, the client still needs the node's URL in order to communicate with it. (I was in a hurry and distracted because I was trying to set up a demo of LAFS-on-S3 during PyCon so it was hard to think carefully.) (See also #1310 -- in my opinion it would be nice to separate the notions, names, and documentation of the directory that holds the gateway's persistent state from that which holds the client's persistent state.)

A tertiary problem is that the error message was a Python backtrace instead of a user-oriented error message, which (depending on its content) could have clued me in faster as to what was the actual problem.

So let's make this ticket to improve the --help text and replace the backtrace with a user-oriented error message.

comment:4 Changed at 2011-03-12T01:08:07Z by davidsarah

  • Keywords error added
  • Milestone changed from undecided to 1.9.0

comment:5 Changed at 2011-10-13T19:54:06Z by davidsarah

  • Milestone changed from 1.9.0 to 1.10.0

comment:6 Changed at 2014-01-21T20:50:26Z by daira

  • Description modified (diff)

#2089 was a duplicate.

Note: See TracTickets for help on using tickets.