﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
1680	Unhandled error in tahoe restart when PID file contains non-numeric value	joepie91	davidsarah	"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."	defect	closed	normal	soon	code-frontend-cli	1.9.1	fixed	easy error tahoe-restart		
