#1680 closed defect (fixed)

Unhandled error in tahoe restart when PID file contains non-numeric value

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

Description (last modified by Lcstyle)

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 (5)

comment:1 Changed at 2012-02-26T13:41:09Z by davidsarah

  • Component changed from code to code-frontend-cli
  • Keywords easy error tahoe-restart added

comment:2 Changed at 2012-02-26T13:41:36Z by davidsarah

  • Milestone changed from undecided to soon
  • Owner changed from somebody to davidsarah
  • Status changed from new to assigned

comment:3 Changed at 2012-04-01T04:17:19Z by davidsarah

  • Milestone changed from soon to 1.11.0
  • Priority changed from minor to normal

comment:4 Changed at 2014-09-27T02:19:43Z by Lcstyle

  • Description modified (diff)

useability, i like it

comment:5 Changed at 2017-11-20T19:53:21Z by Brian Warner <warner@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7e5a87e/trunk:

Merge PR450: delete invalid twistd.pid files

closes ticket:1680

Note: See TracTickets for help on using tickets.