Opened at 2010-02-06T18:49:42Z
Closed at 2013-01-31T15:51:55Z
#937 closed defect (duplicate)
'tahoe run' doesn't work for an introducer node
Reported by: | Bryan Larsen | Owned by: | davidsarah |
---|---|---|---|
Priority: | major | Milestone: | 1.10.0 |
Component: | code-frontend-cli | Version: | 1.6.0 |
Keywords: | docs introducer tahoe-run review-needed | Cc: | |
Launchpad Bug: |
Description
I tried following the instructions (running.html) for creating an introducer, and it didn't work. With some help from secorp on IRC, we determined that I should use "tahoe start dirname" rather than "tahoe run". There's may be an underlying bug that should be fixed, but the install instructions should be fixed irregardless because people use the current install instructions on old versions.
This problem occurred with both 1.5 and 1.6
Attachments (4)
Change History (23)
Changed at 2010-02-06T18:51:24Z by Bryan Larsen
comment:1 Changed at 2010-02-06T19:13:41Z by zooko
- Milestone changed from undecided to 1.7.0
- Version changed from 1.5.0 to 1.6.0
Changed at 2010-03-20T20:45:40Z by duck
comment:2 Changed at 2010-04-03T23:51:57Z by davidsarah
- Component changed from unknown to code-frontend-cli
- Keywords docs introducer added
- Summary changed from install instructions broken for creating an introducer node to 'tahoe run' doesn't work for an introducer node, but is documented to work in running.html
comment:3 Changed at 2010-06-19T01:03:46Z by zooko
- Keywords review-needed added
- Owner changed from nobody to zooko
- Status changed from new to assigned
comment:4 Changed at 2010-06-19T03:12:26Z by davidsarah
- Keywords review-needed removed
- Milestone changed from 1.7.0 to soon
- Summary changed from 'tahoe run' doesn't work for an introducer node, but is documented to work in running.html to 'tahoe run' doesn't work for an introducer node
running.html was corrected in 8f3246430bc0a17b.
Changed at 2010-06-19T04:29:08Z by zooko
comment:5 Changed at 2010-06-19T04:32:26Z by davidsarah
- Keywords reviewed added
comment:6 Changed at 2010-06-19T05:27:20Z by davidsarah
- Keywords reviewed removed
937.dpatch.txt was applied in 49912c106e3dc3de.
comment:7 Changed at 2010-07-21T16:45:09Z by zooko
- Keywords tahoe-run added
comment:8 Changed at 2010-08-08T01:14:00Z by davidsarah
a7c474a09893b9aa makes the error message more explicit, e.g.:
'<dir>' looks like it contains a non-client node (tahoe-introducer.tac). Use 'tahoe start' instead of 'tahoe run'.
comment:9 Changed at 2010-08-08T01:20:46Z by davidsarah
Oh, to debug why tahoe run doesn't work for an introducer (or key-generator or stats-gatherer), you'll now have to disable the check at src/allmydata/scripts/startstop_node.py@4641#L206.
comment:10 Changed at 2012-05-21T00:15:13Z by davidsarah
- Milestone changed from soon to 1.11.0
On #tahoe-lafs:
(00:26:41) makefu|EUER: hi, i am trying to run tahoe in the foreground to let supervisord handle startup. i found the magic line "tahoe run -C /path/to/dir" but when trying to start an introducer i get /path looks like it contains a non-client node (tahoe-introducer.tac).
(00:27:15) makefu|EUER: is there a way to keep tahoe in foreground even for the introducer?
comment:11 Changed at 2012-05-21T00:42:53Z by davidsarah
This seems to be a workaround, assuming Twisted is installed system-wide (replace TAHOE_SOURCE_DIR and X as necessary):
- cd to the introducer directory
- export PYTHONPATH=TAHOE_SOURCE_DIR/support/lib/python2.X/site-packages
- twistd --nodaemon -y tahoe-introducer.tac
comment:12 follow-up: ↓ 16 Changed at 2012-05-21T06:00:15Z by warner
- Keywords review-needed added
that patch should enable "tahoe run" for both client and introducer nodes. The specific issue was that "tahoe run" was hard-wired to load client nodes only; it lacked the code to look at the .tac file (to find out what kind of node was being started) and then load the appropriate code.
I think we decided to switch away from .tac files a while ago, but only "tahoe run" had made any steps in that direction (by hard-coding client.Client instead of loading the .tac file). This moves us a little bit closer. To avoid relying too much on .tac files, at least upon their contents, both tahoe start and tahoe run must decide what nodetype is being started (by looking at the name of the .tac file, or perhaps from other clues): client, introducer, key-generator, stats-gatherer, etc. Then it must load in the appropriate class (client.Client, introducer.server.IntroducerNode, etc), instantiate it, then start the instance.
This patch includes a test for the "emit a nice error message when asked to 'tahoe run' a nodetype that we don't recognize", but it doesn't include a test for normal success of 'tahoe run', since 'run' launches the reactor, and that's not straightforward to do from within a unit test. (note that we didn't previously have coverage of 'tahoe run' either). I've run manual tests and things look ok.
We might consider changing 'tahoe run' to use the "twistd --nodaemon" approach, which would make it look a lot closer to tahoe start. However, that would make it more dependent upon .tac files, not less. In the longer run, I think we should try the approach I came up with in my "toolbed" project, where I create a (in-memory) twistd plugin that creates the desired Node, then set up the twistd arguments that will invoke this plugin, then give control to twistd.runApp in a child process.
comment:13 Changed at 2012-05-23T15:17:14Z by davidsarah
- Owner changed from zooko to davidsarah
- Status changed from assigned to new
comment:14 Changed at 2012-05-23T15:17:29Z by davidsarah
- Status changed from new to assigned
Will review.
comment:15 Changed at 2012-05-23T15:20:57Z by davidsarah
The other tac types are tahoe-key-generator.tac and tahoe-stats-gatherer.tac. Shall we support those while we're about it?
comment:16 in reply to: ↑ 12 Changed at 2012-05-23T15:30:57Z by davidsarah
Replying to warner:
... (note that we didn't previously have coverage of 'tahoe run' either).
That's #1121.
We might consider changing 'tahoe run' to use the "twistd --nodaemon" approach, which would make it look a lot closer to tahoe start. However, that would make it more dependent upon .tac files, not less. In the longer run, I think we should try the approach I came up with in my "toolbed" project, where I create a (in-memory) twistd plugin that creates the desired Node, then set up the twistd arguments that will invoke this plugin, then give control to twistd.runApp in a child process.
... or use the approach I suggested in ticket:1159#comment:17 of using a .tac in the source tree. That solves the main version-skew problems with .tac files, and is possibly less disruptive to the existing code.
comment:17 Changed at 2012-05-23T15:45:27Z by davidsarah
- Milestone changed from 1.11.0 to 1.10.0
comment:18 Changed at 2012-05-25T06:14:27Z by warner
comment:19 Changed at 2013-01-31T15:51:55Z by davidsarah
- Resolution set to duplicate
- Status changed from assigned to closed
Will be fixed by #1159.
Update of install instructions warning against using tahoe run for an introducer.