effigies / BitTornado

UNMAINTAINED - John Hoffman's fork of the original bittorrent
Other
150 stars 44 forks source link

KeyError: 0 #39

Closed Yuuki2012 closed 8 years ago

Yuuki2012 commented 8 years ago

Before it crashed:

Traceback (most recent call last):
  File "/home/BitTornado/BitTornado/Network/RawServer.py", line 109, in listen_forever
    func()
  File "/home/BitTornado/BitTornado/Tracker/track.py", line 1117, in parse_allowed
    [".torrent"])
  File "/home/BitTornado/BitTornado/Application/parsedir.py", line 75, in parsedir
    for _, infohash in unchanged_files.values()}
  File "/home/BitTornado/BitTornado/Application/parsedir.py", line 75, in <dictcomp>
    for _, infohash in unchanged_files.values()}
KeyError: 0

and when starting:

Traceback (most recent call last):
  File "./bttrack.py", line 24, in <module>
    track(sys.argv[1:])
  File "/home/BitTornado/BitTornado/Tracker/track.py", line 1208, in track
    t = Tracker(config, r)
  File "/home/BitTornado/BitTornado/Tracker/track.py", line 415, in __init__
    self.parse_allowed()
  File "/home/BitTornado/BitTornado/Tracker/track.py", line 1117, in parse_allowed
    [".torrent"])
  File "/home/BitTornado/BitTornado/Application/parsedir.py", line 55, in parsedir
    for _, filehash in removed_files.values()}
  File "/home/BitTornado/BitTornado/Application/parsedir.py", line 55, in <dictcomp>
    for _, filehash in removed_files.values()}
KeyError: 0

Tracker isn't starting anymore.

Yuuki2012 commented 8 years ago

Apparently this caused the dstate file to corrupt, because it starts fine with a new one, I'm not sure how to edit it so I can keep my stats...

effigies commented 8 years ago

Ah, gotcha. That makes sense. Still, it should have complained that the state file was corrupt rather than error out.

Check out issue_39. Try it with your old dstate file, and hopefully it'll print an error message but keep going.

Yuuki2012 commented 8 years ago

Okay I pulled it and it starts fine with the old dstate, though no errors printed, I just scraped a few torrents too and everything appears to work.