#355 closed defect (fixed)

'tahoe run' should not fail silently

Reported by: drewp Owned by: warner
Priority: major Milestone: soon
Component: code-nodeadmin Version: 0.9.0
Keywords: usability error tahoe-run Cc: zancas
Launchpad Bug:

Description (last modified by exarkun)

I use supervisord, so I'd like to run tahoe in the foreground.

Change History (15)

comment:1 Changed at 2008-03-17T20:06:38Z by warner

'tahoe start BASEDIR' is really just a wrapper around 'cd BASEDIR; twistd -y *.tac', so you could have supervisord run 'twistd --nodaemon -y foo.tac', and that would leave it in the foreground.

We could also add a --nodaemon option to 'tahoe start', although in that case I'd be tempted to call it 'tahoe run' instead.

comment:2 Changed at 2008-03-19T03:03:04Z by drewp

I see 'tahoe run' is already there, and I'm sorry I missed that before.

But, I have some usability complaints about 'tahoe run':

  1. Simply running 'tahoe run' silently exits with status 1. Nothing is written to console nor ~/.tahoe/logs/twistd.log. Note that I have only a partial ~/.tahoe, since my real instance is somewhere else.
  1. I deliberately tried running in the correct root while my daemonized tahoe was already going, to see what would happen. The result is that "Couldn't listen on any:34279: (98, 'Address already in use')" goes to INSTANCE/logs/tahoesvc.log and then the reactor keeps running. I wish it would write that kind of startup error to the console and then exit 1.

comment:3 follow-up: Changed at 2008-03-20T17:45:18Z by zooko

I guess you missed the existence of tahoe run because it isn't mentioned in docs/running.html. Perhaps we should change that document to describe tahoe run instead of tahoe start? (That document is intended for the beginner, who might prefer the simplicity of tahoe run.)

Something else that might help is if the output of tahoe --help separated node control (start, stop, restart, run, create-client, create-introducer) from filesystem usage (put, get, rm, etc.)

Drew: as someone with "fresh eyes", what do you think about these two proposed changes?

comment:4 follow-up: Changed at 2008-03-20T19:52:24Z by warner

Heh, it probably says something about the documentation when the author of a command forgets about its existence :). Oops.

The ~/.tahoe/ directory is meant to be useable as either a complete Tahoe node (which is why 'tahoe create-client' and 'tahoe start' default to using it) or as a pointer to the URL at which your real node lives (i.e. the 'tahoe ls' command looks in ~/.tahoe/node.url for a starting point).

I need to think more about the startup problems that you hit. Maybe we need a 'chdir' into the target directory in src/allmydata/scripts/startstop_node.py:run().

comment:5 Changed at 2008-03-26T06:31:40Z by drewp

Separating the help into sections would be fine, but that's minor IMHO. It might also help to make start and run look more like peers:

start Start a node as a daemon. run Run a node in the foreground. stop Stop a node daemon. restart Restart a node.

In my case, I don't think I'll put a pointer in ~/.tahoe/node.url since I expect to be running at least two nodes all the time: the test grid and a production friendnet one. I'd rather have tahoe commands fail loudly when I fail to specify an instance directory (as opposed to sometimes accidentally operating on the wrong instance).

Anyway, the silent errors and hangs are much more important to me.

comment:6 in reply to: ↑ 3 Changed at 2009-12-13T05:34:58Z by davidsarah

  • Keywords usability added
  • Summary changed from run daemon in foreground to 'tahoe run' should not fail silently

Documentation improvements split into #856.

comment:7 Changed at 2010-01-16T01:12:37Z by davidsarah

  • Keywords error added

comment:8 Changed at 2010-02-02T03:11:26Z by davidsarah

  • Milestone changed from eventually to 1.7.0

comment:9 Changed at 2010-06-12T22:55:59Z by davidsarah

  • Milestone changed from 1.7.0 to soon

comment:10 Changed at 2010-07-21T16:45:38Z by zooko

  • Keywords tahoe-run added

comment:11 in reply to: ↑ 4 Changed at 2010-08-08T01:28:35Z by davidsarah

Replying to warner:

I need to think more about the startup problems that you hit. Maybe we need a 'chdir' into the target directory in src/allmydata/scripts/startstop_node.py:run().

The current code does that. I don't think that would have addressed the second point in comment:2, though, or similar errors that occur on startup.

comment:12 Changed at 2011-03-25T23:13:44Z by warner

It looks like this is part of the problem making #1360 fail silently (well, at least the "silent" part). Errors during startup are written to logs/tahoesvc.log, which is not where we usually expect them to go (normally I look in logs/twistd.log).

I think we could get rid of "tahoe run" and leave "tahoe start --nodaemon", or change the way "tahoe run" does logging so that any problems during startup get dumped to stderr (in addition to the logfile).

comment:13 Changed at 2011-03-26T01:59:56Z by zooko

I'm still +1 in favor of eliminating tahoe run in favor of tahoe start --nodaemon.

comment:14 Changed at 2011-08-18T03:48:08Z by zooko

  • Cc zancas added

comment:15 Changed at 2020-01-16T19:45:54Z by exarkun

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed

"tahoe start" and the other daemonization commands are now deprecated (https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3273) and "tahoe run" will be the preferred and only way to run a tahoe node after that deprecation period ends.

"tahoe run" exits currently with code 1 when there is no runnable node in ~/.tahoe. When "tahoe run" is used twice against the same node directory, the second attempt exits with code 1 and an error like "Another twistd server is running, PID ...".

Note: See TracTickets for help on using tickets.