#2879 closed defect (fixed)

'magic-folder create' should also create the target local directory

Reported by: cypher Owned by:
Priority: minor Milestone: undecided
Component: unknown Version: 1.12.1
Keywords: magic-folder usability easy Cc:
Launchpad Bug:

Description

Running tahoe magic-folder create magic: user ~/Magic-Folder succeeds as expected, however running tahoe restart afterward will produce an exception with the following traceback as a result of the local directory not existing:

STOPPING '/home/user/.tahoe'
process 2105 is dead
STARTING '/home/user/.tahoe'
starting node in '/home/user/.tahoe'
Traceback (most recent call last):
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 319, in addCallback
    callbackKeywords=kw)
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 308, in addCallbacks
    self._runCallbacks()
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 651, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/user/code/tahoe-lafs/src/allmydata/scripts/runner.py", line 145, in dispatch
    d = defer.maybeDeferred(f, so)
--- <exception caught here> ---
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/home/user/code/tahoe-lafs/src/allmydata/scripts/startstop_node.py", line 244, in restart
    return start(config)
  File "/home/user/code/tahoe-lafs/src/allmydata/scripts/startstop_node.py", line 170, in start
    twistd.runApp(twistd_config)
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 25, in runApp
    _SomeApplicationRunner(config).run()
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/application/app.py", line 379, in run
    self.application = self.createOrGetApplication()
  File "/home/user/venvs/tahoe/local/lib/python2.7/site-packages/twisted/application/app.py", line 439, in createOrGetApplication
    ser = plg.makeService(self.config.subOptions)
  File "/home/user/code/tahoe-lafs/src/allmydata/scripts/startstop_node.py", line 78, in makeService
    return Client(self.basedir)
  File "/home/user/code/tahoe-lafs/src/allmydata/client.py", line 209, in __init__
    self.init_magic_folder()
  File "/home/user/code/tahoe-lafs/src/allmydata/client.py", line 586, in init_magic_folder
    downloader_delay=poll_interval,
  File "/home/user/code/tahoe-lafs/src/allmydata/frontends/magic_folder.py", line 83, in __init__
    self.uploader = Uploader(client, local_path_u, db, upload_dirnode, uploader_delay, clock)
  File "/home/user/code/tahoe-lafs/src/allmydata/frontends/magic_folder.py", line 341, in __init__
    QueueMixin.__init__(self, client, local_path_u, db, 'uploader', clock)
  File "/home/user/code/tahoe-lafs/src/allmydata/frontends/magic_folder.py", line 155, in __init__
    % quote_local_unicode_path(self._local_path_u))
exceptions.AssertionError: The '[magic_folder] local.directory' parameter was '/home/user/Magic-Folder' but there is no directory at that location.

Since this behavior is likely to be surprising to many users -- and since there appears to be no meaningful advantage in having the user create the local directory manually -- consider modifying the behavior of magic-folder create to create the local directory automatically in the event that it doesn't already exist.

Change History (4)

comment:1 Changed at 2017-06-22T14:22:56Z by cypher

  • Keywords usability added

comment:2 Changed at 2017-09-19T19:36:23Z by cypher

  • Priority changed from normal to minor

comment:3 Changed at 2017-09-19T19:44:00Z by cypher

  • Keywords easy added

comment:4 Changed at 2018-05-07T15:52:26Z by meejah

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.