ralphwetzel / theonionbox

Dashboard to monitor Tor node operations
MIT License
122 stars 17 forks source link

KeyError: 'read_history' #18

Closed 0vert1m3 closed 7 years ago

0vert1m3 commented 7 years ago

My Error

[DEBUG] 21:18:52.644 controller.py[145|_get_cache_map]: Controller: Parameter 'ns/                                                                                             id/08d3e6d40b08054d7091c01ca33d9209c48cbbef' added to Refresh procedure.
[WARN]  21:18:52.651 While including 'sections/network_bandwidth/network_bandwidth                                                                                             .html' into 'index_page.html':
Traceback (most recent call last):
  File "/root/theonionbox/theonionbox/pages/index.html", line 70, in <module>
    include(file)
  File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 3376, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 3386, in execute
    eval(self.co, env)
  File "/root/theonionbox/theonionbox/sections/network_bandwidth/network_bandwidth                                                                                             .html", line 14, in <module>
    oo_read = oo_bw.read()
  File "/root/theonionbox/theonionbox/tob/onionoo.py", line 457, in read
    return self.get_chart(self.bw_data, 'read_history', period, self.read_cache)
  File "/root/theonionbox/theonionbox/tob/onionoo.py", line 266, in get_chart
    hist_obj = self._decode_history_object(data, chart, key)
  File "/root/theonionbox/theonionbox/tob/onionoo.py", line 218, in _decode_histor                                                                                             y_object
    hist_obj = data[name]
KeyError: 'read_history'

Debian Jessi 64 bit , python 2.7.x ..

The error starts on the login : http://image.prntscr.com/image/a33360f2796f4239b96b00c243a36271.png

ralphwetzel commented 7 years ago

Hi! Thanks for providing this info. Checking the Tor network data your relay seems to be so young that it doesn't have any historical info stored. I wasn't aware this could be the case. The good thing is, time will fix your issue. Nevertheless it's a bug in my code.

Best regards, Ralph

ralphwetzel commented 7 years ago

Fixed with release v3.0.3.