#1680 closed defect

Unhandled error in tahoe restart when PID file contains non-numeric value — at Initial Version

Reported by: joepie91 Owned by: somebody
Priority: normal Milestone: soon
Component: code-frontend-cli Version: 1.9.1
Keywords: easy error tahoe-restart Cc:
Launchpad Bug:

Description

When the twistd.pid file in the Tahoe-LAFS node/client directory contains a non-numeric value (which was somehow the case after unexpected power loss on a server), this error is not handled properly when running tahoe restart.

Output:

tahoe@vps2:~/allmydata-tahoe-1.9.1/bin$ ./tahoe restart
STOPPING '/home/tahoe/.tahoe'
Traceback (most recent call last):
  File "/home/tahoe/allmydata-tahoe-1.9.1/support/bin/tahoe", line 9, in <module>
    load_entry_point('allmydata-tahoe==1.9.1', 'console_scripts', 'tahoe')()
  File "/home/tahoe/allmydata-tahoe-1.9.1/src/allmydata/scripts/runner.py", line 113, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/home/tahoe/allmydata-tahoe-1.9.1/src/allmydata/scripts/runner.py", line 95, in runner
    rc = startstop_node.dispatch[command](so, stdout, stderr)
  File "/home/tahoe/allmydata-tahoe-1.9.1/src/allmydata/scripts/startstop_node.py", line 140, in restart
    rc = stop(config, stdout, stderr)
  File "/home/tahoe/allmydata-tahoe-1.9.1/src/allmydata/scripts/startstop_node.py", line 92, in stop
    pid = int(pid)
ValueError: invalid literal for int() with base 10: '3 s'

The tahoe start command appears to have proper error handling, but does not make clear that the daemon has not been started - it looks like a warning rather than an error:

tahoe@vps2:~/allmydata-tahoe-1.9.1/bin$ ./tahoe start
STARTING '/home/tahoe/.tahoe'
Pidfile /home/tahoe/.tahoe/twistd.pid contains non-numeric value

(the above code snippet with the tahoe start command was run before the tahoe restart command)

Workaround:

Remove the $tahoedir/twistd.pid file (where $tahoedir is the directory your tahoe.cfg resides in) and manually ensure no daemons are running before starting the daemon.

Change History (0)

Note: See TracTickets for help on using tickets.